首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何利用声音本身来演绎声音?

如何利用声音本身来演绎声音?
EN

Stack Overflow用户
提问于 2012-09-25 17:36:54
回答 1查看 35关注 0票数 1

我刚接触Xcode中的声音,我希望重复播放一个声音,无论它是否已经在播放。例如:我有三个正在拍摄的激光,我希望激光声音同时播放三次,而不是等待每一个都播放完。如何使用AVAudioPlayer实现这一点?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-09-25 17:59:19

执行以下操作:

代码语言:javascript
复制
AVAudioPlayer *laserSound1  = .........
laserSound1.numberOfLoops = 2; //plays three times simultaneously
[laserSound1 play];

 AVAudioPlayer *laserSound2  = .........
laserSound2.numberOfLoops = 2;//plays three times simultaneously
[laserSound2 play];

AVAudioPlayer *laserSound3  = .........
laserSound3.numberOfLoops = 2;//plays three times simultaneously
[laserSound3 play];
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12580177

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档