AVAudioPlayer - Drop in Framerate

廉价感情. 提交于 2019-12-01 08:15:02

For future reference, here is the solution:

Setting the audio session category to kAudioSessionCategory_AmbientSound (to allow for iPod music to play simultaneously) somehow disables MP3 hardware acceleration. Setting the audio category to kAudioSessionCategory_SoloAmbientSound fixes this, but doesn't allow for iPod playback. I do now set the audio session category depending on whether background music is enabled or disabled to allow for simultaneous iPod playback.

The mp3 is an encoded/compressed audio format. You can try either to reduce the sampling rate (for istance, instead of 128 kb/s try 64 kb/s) or switch to a non encoded format such as linear pcm. The cons are: lower audio quality in the former case, higher file size in the latter. But this can help improve the overall performances of your app.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!