私のアプリでは、自分のサウンドを再生している間、バックグラウンド ミュージックを一時停止して再開する必要があります。
iPod のアプローチは、以下を使用することです。
[[MPMusicPlayerController iPodMusicPlayer] pause];
と :
[[MPMusicPlayerController iPodMusicPlayer] play];
iPod 以外のアプリの場合、これは影響しません。
2 番目の試みは、ダッキングを有効にすることです。
UInt32 property = sender.on;
AudioSessionSetProperty(kAudioSessionProperty_OtherMixableAudioShouldDuck,sizeof(property),&property);
AudioSessionSetActive(property);
Spotify ではなく、iPod 音楽プレーヤーでも機能します。
設定kAudioSessionCategory_SoloAmbientSound
はすべての音楽を停止しますが、再開しません。