开发者

Most convenient way to play sound in iOS games?

I'm making a game and would like to have a background loop of game music and on top of it have two different channels of sound effects. I would like to control the volume of these channels. I looked at fmod, but it was out of my budget. Now instead I'm looking at the MixerHostAudio example provided by Apple. It's a clear example, but a bit long-winded being 1000+ lines just for playing two sound开发者_开发技巧s, so I'm wondering if I should be doing something else instead.

My ideal API would look something like this:

SoundSystem *sounds = [SoundSystem soundSystemWithLoop:@"koto.mp3"]; 
[sounds play:@"chimes.mp3" channel:1 looping:YES volume:0.0];
[sounds fadeTo:1.0 channel:1 delay:0.5];
[sounds play:@"buddha_bell.mp3" channel:2];


You can use AVAudioPlayer for the background loop and Finch for SFX. Both are easy to work with. You’d have to write the channel volume control above Finch yourself, but that’s not hard either, being just an array of sounds with a common volume control.


CocosDenshion Sound Engine does everything you want.

It is trivial to use once you get it in your project.

CocosDenshion is the sound part of Cocos2D.

I just personally do not care for Cocos2D (although, of course, many people love it and use it).

However CocosDenshion for sound does everything you want with no problems. Yes it does both BG loops and SFX. It manages all memory, etc.

It is easy to use CocosDenshion (just copy a few files to your project) -- no problem. (You do not have to fool with the whole Cocos2D situation...you install simply only the Denshion section.)

Hope it helps!


I'm using SoundMaster engine. It's much better than CocosDension Sound Engine, because of ARC support, memory management and many other features like fade in/out, or relative volumes for effects.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜