我正在使用Web Audio API的麦克风输入,需要获取音量值。
目前,我已经成功让麦克风工作: http://updates.html5rocks.com/2012/09/Live-Web-Audio-Input-Enabled
此外,我知道有一种方法可以操作音频文件的音量: http://www.html5rocks.com/en/tutorials/webaudio/intro/
// Create a gain node.
var gainNode = context.createGain();
// Connect the source to the gain node.
source.connect(gainNode);
// Connect the gain node to the destination.
gainNode.connect(context.destination);
// Reduce the volume.
gainNode.gain.value = 0.5;
但是如何将这两者结合起来并获得输入音量值呢?我只需要这个值,不需要对其进行操作。
有人知道吗?
getByteFrequencyData
而不是getByteTimeDomainData
? - bennlich