开发者

maximize the sound effect in iPhone game by code?

开发者 https://www.devze.com 2022-12-16 21:38 出处:网络
I just builta game. It already has all the sounds. But for some reasons the sound effect of the click bu开发者_Python百科tton is still small. How could I maximize the volume. I am not sure it is becau

I just built a game. It already has all the sounds. But for some reasons the sound effect of the click bu开发者_Python百科tton is still small. How could I maximize the volume. I am not sure it is because of the quality of the sound files itself or because I din't increase the volume by code? could you guys help me out. Thanks in advance. Here is my code.

-(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);
}


From the System Sound Services Reference:

The interface does not provide level, positioning, or timing control

I would assume level implies volume.

If you use AVAudioPlayer you can set the volume from 0.0 to 1.0 with the volume property, but I am sure that opens up a new set of problem tradeoffs.

0

精彩评论

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