Background iPod music Volume mixed with sound effects

99封情书 提交于 2019-12-11 13:31:36

问题


What would the best method be for mixing background iPod music with sound effects? The sound effects need to be adjustable and sometimes much louder than the background music. When I use MPMusicPlayerController the volume is system-wide and reduces the effects volume as well. I have been reading about AVPlayer and AVAudipPlayer but can't seem to locate a viable solution.

Any help and suggestions would be greatly appreciated.


回答1:


Have you looked at AVAudioSession Categories? I think that could help you with your problem. The docs at Apple.




回答2:


The problem is that you cannot play much louder sound over iPod music library because as you wrote iPod music use system volume. Unless the music files in your iPod library is compressed with very low volume.

Cocos 2D framework integrates very nice way how to mix-up more sound sources, but again it uses AVAudioPlayer for background music and Open AL for other sounds.



来源:https://stackoverflow.com/questions/8071923/background-ipod-music-volume-mixed-with-sound-effects

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