1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

iOS: Restore sample rate after iterating available sample rates

This commit is contained in:
Anthony Nicholls 2025-02-26 14:06:41 +00:00
parent 76e498f495
commit f985cf0c31

View file

@ -610,6 +610,8 @@ struct iOSAudioIODevice::Pimpl final : public AsyncUpdater
sampleRates.addIfNotAlreadyThere (highestRate);
sampleRate = trySampleRate (sampleRate);
AudioUnitAddPropertyListener (audioUnit,
kAudioUnitProperty_StreamFormat,
dispatchAudioUnitPropertyChange,
@ -644,13 +646,6 @@ struct iOSAudioIODevice::Pimpl final : public AsyncUpdater
JUCE_IOS_AUDIO_LOG ("Updating hardware info");
updateAvailableSampleRates();
// The sample rate and buffer size may have been affected by
// updateAvailableSampleRates(), so try restoring the last good
// sample rate
sampleRate = trySampleRate (sampleRate);
bufferSize = getBufferSize (sampleRate);
updateAvailableBufferSizes();
if (deviceType != nullptr)