sbooth / SFBAudioEngine

A powerhouse of audio functionality for macOS and iOS
https://sbooth.github.io/SFBAudioEngine/
MIT License
552 stars 87 forks source link

Attempt to preserve the player's state after interruption #144

Closed sbooth closed 4 years ago

sbooth commented 4 years ago

After receiving AVAudioEngineConfigurationChangeNotification attempt to transfer the current and queued decoders from the previous SFBAudioPlayerNode and restore playback state to what it was before the interruption.

sbooth commented 4 years ago

Instead of transferring the decoders, since the SFBAudioPlayerNode's rendering format doesn't change during AVAudioEngineConfigurationChangeNotification processing, don't create a new SFBAudioPlayerNode.