tags:

views:

156

answers:

1

Hi everyone.

I have a newly created game using Cocos2D on the iPhone. I am at the sound implementation portion now. I could implement the sounds. But it somehow has a small volum. Especially, the click button effect sounds. They are too small. Could you guys show me how to increase the volumn of that particular sound please? Here is my code for the button sound. I will call this at where I click the button.

-(void) play
{
    NSString *path = [NSString stringWithFormat:@"%@%@",[[NSBundle mainBundle] resourcePath],@"/menu_button_2.wav"];
    SystemSoundID soundID;
    NSURL *filePath = [NSURL fileURLWithPath:path isDirectory :NO];
    AudioServicesCreateSystemSoundID((CFURLRef)filePath ,&soundID);
    AudioServicesPlaySystemSound(soundID);
    //AudioServicesDisposeSystemSoundID (soundID);
}
+2  A: 

AudioServicesPlaySystemSound will play at the current system sound, you can increase the sound by using the AVAudioPlayer facility instead of the standard audio services.

some tips here:

http://webbuilders.wordpress.com/2009/03/28/when-to-go-with-avaudioplayer-on-iphone-sdk/

could also be the wav is mixed at a very low volume? you could increase the volume with something like audacity (http://audacity.sourceforge.net/)

jspcal
Thanks for reply. I am not familar with the sounds stuff. I have 2 types of formats, for the background music is mp3, for the click effects are wav. Is it because I have 2 different sounds format cause the low volume ?
Rocker