Use more then one sound in my iPhone application using Cocos2d(使用 Cocos2d 在我的 iPhone 应用程序中使用多个声音)
问题描述
avc = [[MPAVController sharedInstance] avController];
//avc is AVController
NSString *path = [[NSBundle mainBundle] pathForResource:@"Sound" ofType:@"wav"];
id feeder = [[MPArrayQueueFeeder alloc] initWithPaths:[NSArray arrayWithObject:path]];
[avc setQueueFeeder:feeder];
[avc play:nil];
[feeder release];
NSTimer *sound = [NSTimer scheduledTimerWithTimeInterval:(9.0) target:self selector:@selector(Gamesoundplay) userInfo:nil repeats:YES];
听说我使用拖曳框架来播放声音.1.MediaPlayer.framework2. AudioToolbox.framework
Hear i use tow framework for playing sound. 1. MediaPlayer.framework 2. AudioToolbox.framework
我在加载游戏后成功播放了带有重复的背景声音.我还想在单击某些按钮操作后播放声音而不停止以前的背景声音.但是当我单击另一个按钮时,时间背景声音停止并在我提到重复声音时间线的时间间隔(9.0 秒)后重新开始.
I success to play the background sound with repeat after loading the game. I also want to play sound after clicking some button action without stop the previous background sound. But when I click the other button that time background sound is stop and start again after time intereval ( 9.0 sec ) which I mention for repeated the sound time line.
如果有人从事这项工作,那么请帮助我完成我的申请.
If anyone do this work then help me to complete my application.
推荐答案
开源游戏引擎 Cocos2d iPhone 有一个名为Cocos Denshion"的库,它封装了在 iPhone 上播放背景声音和效果声音.
The open source game engine Cocos2d iPhone has a library called "Cocos Denshion" that wraps up playing background sound and effect sounds on the iPhone.
在这里获取 cocos(其中包含 Denishon):
Get cocos (with Denishon in it) here:
http://www.cocos2d-iphone.org/download
并在此处查看如何使用 Cocos Denishon:
And check here for how to use Cocos Denishon:
http://www.cocos2d-iphone.org/wiki/doku.php/cocosdenshion:cookbook
这篇关于使用 Cocos2d 在我的 iPhone 应用程序中使用多个声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 Cocos2d 在我的 iPhone 应用程序中使用多个声音


- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- android 4中的android RadioButton问题 2022-01-01