我正在使用这行代码来设置声源增益。我想增加声音的音量,(如iOS中的闹钟),但如果我尝试设置大于1.0的增益,它不会起作用。
在文档中说
/**
* Indicate the gain (volume amplification) applied.
* Type: ALfloat.
* Range: ]0.0- ]
* A value of 1.0 means un-attenuated/unchanged.
* Each division by 2 equals an attenuation of -6dB.
* Each multiplicaton with 2 equals an amplification of +6dB.
* A value of 0.0 is meaningless with respect to a logarithmic
* scale; it is interpreted as zero volume - the channel
* is effectively disabled.
*/
#define AL_GAIN 0x100A
alSourcef(source, AL_GAIN, 4.0f);//Set gain/volume - 4.0f sounds the same as 1.0f gain
我做错了吗?如果增益不起作用,还有其他方法可以增加声音的音量。 感谢
答案 0 :(得分:1)
值1.0表示未衰减/未变化。因此,1.0f以上的值与1.0f相同。