2

I am using the following method, and express a sound effect in cocos2d.

[[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"BackGround.m4a"];

But sound volume of BackgroundMusic is too small.

so, is there a way that adjust a sound volume?

Guru
  • 21,652
  • 10
  • 63
  • 102
S.J. Lim
  • 3,095
  • 3
  • 37
  • 55
  • Btw, I seperated the CocosDenshion API reference from the Cocos2D API reference, makes it much easier to look up CocosDenshion-specific classes: http://www.learn-cocos2d.com/api-ref/latest/CocosDenshion/html/interface_simple_audio_engine.html – CodeSmile Dec 01 '11 at 16:50

2 Answers2

4
[[SimpleAudioEngine sharedEngine]setBackgroundMusicVolume:1.0f];

From 0.0f to 1.0f.

Saturn
  • 17,888
  • 49
  • 145
  • 271
2

The backgroundMusicVolume property of the SimpleAudioEngine class can be used for this.

- (float) backgroundMusicVolume [read, write, assign]

   //Background music volume. Range is 0.0f to 1.0f. This will only have an effect if willPlayBackgroundMusic returns YES
Mike Fahy
  • 5,487
  • 4
  • 24
  • 28