【问题标题】:Is it possible to adjust the sound volume cocos2d?cocos2d可以调节音量吗?
【发布时间】:2012-01-10 19:18:37
【问题描述】:

我是用下面的方法,在cocos2d中表达音效。

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

但是BackgroundMusic的音量太小了。

那么,有没有办法调节音量?

【问题讨论】:

标签: cocos2d-iphone simpleaudioengine


【解决方案1】:
[[SimpleAudioEngine sharedEngine]setBackgroundMusicVolume:1.0f];

从 0.0f 到 1.0f。

【讨论】:

    【解决方案2】:

    SimpleAudioEngine 类的backgroundMusicVolume 属性可用于此目的。

    - (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
    

    【讨论】:

      猜你喜欢
      • 2020-08-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多