背景 iPod 音乐音量与音效混合
将 iPod 背景音乐与音效混合的最佳方法是什么?音效需要可调,有时比背景音乐响亮得多。当我使用 MPMusicPlayerController 时,音量是系统范围的,并且也会降低效果音量。我一直在阅读有关 AVPlayer
和 AVAudipPlayer
的内容,但似乎找不到可行的解决方案。
任何帮助和建议将不胜感激。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题是您无法通过 iPod 音乐库播放更大的声音,因为您编写 iPod 音乐时使用系统音量。除非您的 iPod 库中的音乐文件被压缩得非常低。
Cocos 2D 框架集成了混合更多声源的非常好的方法,但它再次使用 AVAudioPlayer 来播放背景音乐,使用 Open AL 来播放其他声音。
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.
您看过 AVAudioSession 类别吗?我认为这可以帮助你解决你的问题。 Apple 的文档。
Have you looked at AVAudioSession Categories? I think that could help you with your problem. The docs at Apple.