我正在开发一款基于音乐的 IOS 游戏,需要在背景音乐和全局计时器之间严格同步,所以我正在寻找一种播放音乐的方式,同时知道音乐的确切位置每次更新帧时都在播放.
I'm working on a IOS game based on music, and a strict synchronize between background music and global timer is necessary, so I'm looking for some way to play music AND at the same time knowing which exact position the music is playing on at each frame update.
OALSimpleAudio
没有这种接口.有没有更好的解决方案?谢谢!
the OALSimpleAudio
Doesn't have such kind of interface. Are there any better solution? Thank you!
OALSimpleAudio Background-Music (OALAudioTrack) 使用 AVAudioPlayer.
OALSimpleAudio Background-Music (OALAudioTrack) uses the AVAudioPlayer.
试试:
[[[[OALSimpleAudio sharedInstance] backgroundTrack] player] currentTime]
这篇关于如何在 cocos2d ios 中播放 BGM 并知道当前播放时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!