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

查看:14
本文介绍了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天全站免登陆