From 8fbabc4dfc23d593c964b257782ec62a1e0ca4a6 Mon Sep 17 00:00:00 2001 From: Ruurd Adema Date: Fri, 19 Aug 2016 21:18:06 +0200 Subject: [PATCH] Fixed issue with CoreAudio stereo stream being mono --- src/coreaudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreaudio.c b/src/coreaudio.c index a483b53..39f16a7 100644 --- a/src/coreaudio.c +++ b/src/coreaudio.c @@ -1169,7 +1169,7 @@ static OSStatus read_callback_ca(void *userdata, AudioUnitRenderActionFlags *io_ assert(audio_buffer->mNumberChannels == instream->layout.channel_count); assert(audio_buffer->mDataByteSize == in_number_frames * instream->bytes_per_frame); for (int ch = 0; ch < instream->layout.channel_count; ch += 1) { - isca->areas[ch].ptr = ((char*)audio_buffer->mData) + instream->bytes_per_sample; + isca->areas[ch].ptr = ((char*)audio_buffer->mData) + (instream->bytes_per_sample * ch); isca->areas[ch].step = instream->bytes_per_frame; } } else {