gpt4 book ai didi

javascript - 如何在 Web Audio API 中使用 LFO 调制 AudioParam

转载 作者:行者123 更新时间:2023-11-30 07:09:29 24 4
gpt4 key购买 nike

我如何调制 Web Audio API 中的任何 AudioParams,例如使用低频振荡器的 GainNode 的增益值?

最佳答案

https://coderwall.com/p/h1jnmg

var saw = context.createOscillator(),
sine = context.createOscillator(),
sineGain = context.createGainNode();

//set up our oscillator types
saw.type = saw.SAWTOOTH;
sine.type = sine.SINE;

//set the amplitude of the modulation
sineGain.gain.value = 10;

//connect the dots
sine.connect(sineGain);
sineGain.connect(saw.frequency);

关于javascript - 如何在 Web Audio API 中使用 LFO 调制 AudioParam,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15820746/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com