diff options
| author | Andre Weissflog <floooh@gmail.com> | 2018-09-23 20:46:28 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2018-09-23 20:46:28 +0200 |
| commit | 79cce6f1331ce0024e6ed84d0276b8118c0473dd (patch) | |
| tree | 2f287ac5100f64db710597a80082b5ce94ff5a16 /sokol_audio.h | |
| parent | c7b09ba12708983fad0e2ff972bf2d3df0ffb206 (diff) | |
sokol-audio: stereo support in OSX CoreAudio backend
Diffstat (limited to 'sokol_audio.h')
| -rw-r--r-- | sokol_audio.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sokol_audio.h b/sokol_audio.h index f612154d..4c035896 100644 --- a/sokol_audio.h +++ b/sokol_audio.h @@ -488,10 +488,10 @@ _SOKOL_PRIVATE bool _saudio_backend_init(void) { fmt.mSampleRate = (Float64) _saudio.sample_rate; fmt.mFormatID = kAudioFormatLinearPCM; fmt.mFormatFlags = kLinearPCMFormatFlagIsFloat | kAudioFormatFlagIsPacked; - fmt.mBytesPerPacket = 4; fmt.mFramesPerPacket = 1; - fmt.mBytesPerFrame = 4; - fmt.mChannelsPerFrame = 1; + fmt.mChannelsPerFrame = _saudio.num_channels; + fmt.mBytesPerFrame = sizeof(float) * _saudio.num_channels; + fmt.mBytesPerPacket = fmt.mBytesPerFrame; fmt.mBitsPerChannel = 32; OSStatus res = AudioQueueNewOutput(&fmt, _sapp_ca_callback, 0, NULL, NULL, 0, &_saudio_ca_audio_queue); SOKOL_ASSERT((res == 0) && _saudio_ca_audio_queue); |