简体   繁体   中英

how to know which song is playing in avaudioplayer

如何知道avaudioplayer中正在播放哪首歌

just get its property .url:

  //NO:  your.AVAudioPlayer.url;

EDIT:

yourAVAudioPlayer.url; // 

The "url" property of AVAudioPlayer returns the file path of the file currently being played.

I have a feeling what you're actually asking is how to find out which song is playing in the system though. In which case you should use nowPlayingItem in MPMusicPlayerController. This shows, for example, which song is playing in iTunes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM