Skip to content

Commit

Permalink
Use correct number of channels for the selected CoreAudio stream
Browse files Browse the repository at this point in the history
The kAudioStreamPropertyPhysicalFormat query returns the number
of channels for the device's first audio stream. If any single,
subsequent stream is selected to fulfill the user request, it may
use a different number of channels. This mismatch can cause a lot
of problems.
  • Loading branch information
mikedickey committed Feb 11, 2024
1 parent 584a683 commit 9929045
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RtAudio.cpp
Expand Up @@ -1782,7 +1782,7 @@ bool RtApiCore :: probeDeviceOpen( unsigned int deviceId, StreamMode mode, unsig
stream_.deviceFormat[mode] = RTAUDIO_FLOAT32;

if ( streamCount == 1 )
stream_.nDeviceChannels[mode] = description.mChannelsPerFrame;
stream_.nDeviceChannels[mode] = streamChannels;
else // multiple streams
stream_.nDeviceChannels[mode] = channels;
stream_.nUserChannels[mode] = channels;
Expand Down

0 comments on commit 9929045

Please sign in to comment.