音の生成終了後。5%の設定で最大振幅0.0500を確認。
音の生成終了後。5%の設定で最大振幅0.0500を確認。 タップして拡大できます。

// ボタンの操作から開始
const context = new AudioContext();
await context.resume();
const tone = context.createOscillator();
const gain = context.createGain();
tone.frequency.value = 660;
gain.gain.value = 0.05;
tone.connect(gain).connect(context.destination);
tone.start();
tone.stop(context.currentTime + 0.35);