| 202 | // ── AudioStreamBasicDescription helper ────────────────────────────────────── |
| 203 | |
| 204 | static AudioStreamBasicDescription makePCMFormat(Float64 sampleRate, UInt32 channels) |
| 205 | { |
| 206 | AudioStreamBasicDescription fmt{}; |
| 207 | fmt.mSampleRate = sampleRate; |
| 208 | fmt.mFormatID = kAudioFormatLinearPCM; |
| 209 | fmt.mFormatFlags = kAudioFormatFlagIsFloat | kAudioFormatFlagIsPacked; |
| 210 | fmt.mBitsPerChannel = 32; |
| 211 | fmt.mChannelsPerFrame = channels; |
| 212 | fmt.mBytesPerFrame = channels * sizeof(float); |
| 213 | fmt.mFramesPerPacket = 1; |
| 214 | fmt.mBytesPerPacket = fmt.mBytesPerFrame; |
| 215 | return fmt; |
| 216 | } |
| 217 | |
| 218 | // ── DriverRequestHandler: defers device creation until host is ready ───────── |
| 219 | |