Browse Source

iOS: Fixed a bug in the audio channels of the simulator and older versions of iOS

tags/2021-05-28
tpoole 8 years ago
parent
commit
a2bf8d49b6
2 changed files with 12 additions and 1 deletions
  1. +6
    -1
      modules/juce_audio_devices/native/juce_ios_Audio.cpp
  2. +6
    -0
      modules/juce_audio_processors/processors/juce_AudioProcessor.cpp

+ 6
- 1
modules/juce_audio_devices/native/juce_ios_Audio.cpp View File

@@ -1195,6 +1195,10 @@ struct iOSAudioIODevice::Pimpl : public AudioPlayHead,
result.add (nsStringToJuce (desc.channelName));
}
// A fallback for the iOS simulator and older iOS versions
if (result.isEmpty())
return { "Left", "Right" };
return result;
}
@@ -1202,8 +1206,9 @@ struct iOSAudioIODevice::Pimpl : public AudioPlayHead,
BigInteger requiredChannels)
{
requiredChannels.setRange (numHardwareChannelsAvailable,
requiredChannels.getHighestBit(),
requiredChannels.getHighestBit() + 1,
false);
return requiredChannels;
}


+ 6
- 0
modules/juce_audio_processors/processors/juce_AudioProcessor.cpp View File

@@ -395,9 +395,15 @@ void AudioProcessor::setPlayConfigDetails (const int newNumIns,
if (getTotalNumInputChannels() != newNumIns)
success &= setChannelLayoutOfBus (true, 0, AudioChannelSet::canonicalChannelSet (newNumIns));
// failed to find a compatible input configuration
jassert (success);
if (getTotalNumOutputChannels() != newNumOuts)
success &= setChannelLayoutOfBus (false, 0, AudioChannelSet::canonicalChannelSet (newNumOuts));
// failed to find a compatible output configuration
jassert (success);
// if the user is using this method then they do not want any side-buses or aux outputs
success &= disableNonMainBuses();
jassert (success);


Loading…
Cancel
Save