| @@ -251,6 +251,8 @@ public: | |||||
| Array<double> getAvailableSampleRates() | Array<double> getAvailableSampleRates() | ||||
| { | { | ||||
| const ScopedLock sl (callbackLock); | |||||
| Array<double> rates; | Array<double> rates; | ||||
| // Important: the supported audio sample rates change on the iPhone 6S | // Important: the supported audio sample rates change on the iPhone 6S | ||||
| @@ -269,23 +271,20 @@ public: | |||||
| { | { | ||||
| const double supportedRate = trySampleRate (rate); | const double supportedRate = trySampleRate (rate); | ||||
| rates.addIfNotAlreadyThere (supportedRate); | |||||
| if (rates.addIfNotAlreadyThere (supportedRate)) | |||||
| JUCE_IOS_AUDIO_LOG ("available rate = " + String (supportedRate, 0) + "Hz"); | |||||
| rate = jmax (rate, supportedRate); | rate = jmax (rate, supportedRate); | ||||
| } | } | ||||
| trySampleRate (owner.getCurrentSampleRate()); | trySampleRate (owner.getCurrentSampleRate()); | ||||
| updateCurrentBufferSize(); | |||||
| AudioUnitAddPropertyListener (audioUnit, | AudioUnitAddPropertyListener (audioUnit, | ||||
| kAudioUnitProperty_StreamFormat, | kAudioUnitProperty_StreamFormat, | ||||
| handleStreamFormatChangeCallback, | handleStreamFormatChangeCallback, | ||||
| this); | this); | ||||
| for (auto r : rates) | |||||
| { | |||||
| ignoreUnused (r); | |||||
| JUCE_IOS_AUDIO_LOG ("available rate = " + String (r, 0) + "Hz"); | |||||
| } | |||||
| return rates; | return rates; | ||||
| } | } | ||||
| @@ -866,10 +865,10 @@ private: | |||||
| // array in this application's .plist file. | // array in this application's .plist file. | ||||
| jassert (err == noErr); | jassert (err == noErr); | ||||
| err = AudioUnitAddPropertyListener(audioUnit, | |||||
| kAudioUnitProperty_IsInterAppConnected, | |||||
| audioUnitPropertyChangeDispatcher, | |||||
| this); | |||||
| err = AudioUnitAddPropertyListener (audioUnit, | |||||
| kAudioUnitProperty_IsInterAppConnected, | |||||
| audioUnitPropertyChangeDispatcher, | |||||
| this); | |||||
| jassert (err == noErr); | jassert (err == noErr); | ||||
| #endif | #endif | ||||