如何同时播放2种声音
我必须在我的应用程序中播放 2 种声音...一种用于背景,另一种用于用户单击任何按钮时...不是我只有一种背景声音,而该按钮单击时有太多声音...全部声音是 mp3 格式....
我正在使用 AVAudioPlayer 来播放这些声音...
我的问题是
1-我可以同时播放这 2 个 mp3 声音吗或者我应该将该背景声音转换为任何其他格式...
2-我正在使用 AVAudioPlayer 来播放这些声音......我可以吗在同一个类中使用 2 个 AVAudioPlayer 实例......
请注意,我希望背景音乐连续播放......
请帮忙......
I have to play 2 sounds in my app...one for background and one for when user clicks any button.....Not i have only one sound for background and too many sounds for that button click.....all sounds are in mp3 format....
I am using AVAudioPlayer to play these sounds...
My questions are
1- Can i play these 2 mp3 sounds at same time Or should i convert that background sound to any other format....
2- I am using AVAudioPlayer to play these sounds.....so can i use 2 instances of AVAudioPlayer in same class......
Please Note that i want that background music continuously playing.....
Please help....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
1.,是的,你甚至可以更多..
2.,是的,你可以使用AVAudioPlayer来播放这些,每个音源必须单独分配。
如果您有不需要立体声的短声音,您可以使用系统声音框架来使它们播放。
1., Yes, you can even more..
2., Yes you can use AVAudioPlayer to play these, each sound source have to be allocated separately.
If you have short sounds that does not need to be stereo, you can use system sound framework to make them play.
看看下面的内容,会对你有所帮助。
iPhone 中同时播放 2 个 mp3 声音?
和博客教程
http://brainwashinc。 wordpress.com/2009/08/14/iphone-playing-2-sounds-at-once/
Have a look to below look, will helpful for you.
2 mp3 sounds at the same time in iphone?
and blog tutorial
http://brainwashinc.wordpress.com/2009/08/14/iphone-playing-2-sounds-at-once/