是否可以调节音量cocos2d? [英] Is it possible to adjust the sound volume cocos2d?

查看:177
本文介绍了是否可以调节音量cocos2d?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下方法,并在cocos2d中表达声音效果。

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

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

但BackgroundMusic的音量太小。

But sound volume of BackgroundMusic is too small.

所以,有没有办法调整音量?

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

推荐答案

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

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

这篇关于是否可以调节音量cocos2d?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆