3

I am wondering if it would be possible to insert your own audio once the ios media library has taken over in an app?

Example: Playing a piece of audio after every song that says the number of songs you've listened to that day.

I know that because its a framework there is only so many things they let you do.

4

1 回答 1

2

这应该是可行的。首先,您可以添加您的类作为MPMusicPlayerControllerNowPlayingItemDidChangeNotificationiPod 库中的歌曲更改时收到通知的观察者。从那里,您可以告诉 iPod 库暂停、播放您的曲目,然后再继续播放音乐。

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(someSel:) name:MPMusicPlayerControllerNowPlayingItemDidChangeNotification object:nil];


[[MPMusicPlayerController iPodMusicPlayer] pause];
    // play your sound
[[MPMusicPlayerController iPodMusicPlayer] play];
于 2013-08-23T20:44:48.180 回答