问题描述
我想通过连接到其他 OscillatorNode 来调制 Web Audio API OscillatorNode 的方波.但是我在 AudioParams 中找不到参数.
I want to modulate the square waveform of the Web Audio API OscillatorNode by connecting to other OscillatorNodes. But I can not find the parameter in the AudioParams.
这是可能的还是有解决方法?
Is this possible at all or is there a workaround?
我想过使用audioContext.createWaveTable()"函数创建一个自定义"波表振荡器.该波表可以包含具有扫描脉冲宽度的不同脉冲.
I thought about creating a "custom" wavetable Oscillator with the "audioContext.createWaveTable()" function. This wavetable could contain different pulses with sweeping pulsewidths.
但我不知道如何通过 AudioParams 控制波表指针的位置来调制扫描.
But than again I have no idea how to control the position of the wavetable pointer via AudioParams to modulate the sweep.
这是可能的还是我对这个 API 的工作原理有根本的误解?
Is this possible or do I have a fundamental misunderstanding how this API works?
推荐答案
恐怕不行.我们的振荡器中还没有脉宽调制.您必须在脚本处理器节点中手动完成.
You can't, I'm afraid. We don't have pulse-width modulation in the oscillator yet. You'll have to do it by hand in a script processor node.
这篇关于如何调制 Web Audio API Square OscillatorNode 的脉宽?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!