2
我有一款在iPhone上使用Cocos2D的新創建的遊戲。我現在在健全的實施部分。我可以實現聲音。但它以某種方式有一個小容量。特別是,點擊按鈕效果聽起來。他們太小了。你們能告訴我如何增加特定聲音的音量嗎?這是我的按鈕聲音代碼。我會在點擊按鈕的地方打這個電話。在iPhone遊戲開發中爲音效增加音量
-(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種格式,背景音樂是mp3,點擊效果是wav。是因爲我有兩種不同的聲音格式會導致低音量? – Rocker 2010-01-18 02:45:34