Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fky1990 committed Jan 23, 2025
1 parent f823701 commit 857113a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ async function ensureAudioInitialized() {
}
if (!audioStreamer) {
audioStreamer = new AudioStreamer(audioCtx);
// 创建gain node并将音量设置为2倍
const gainNode = audioCtx.createGain();
gainNode.gain.value = 2.0;
audioStreamer.setGainNode(gainNode);
await audioStreamer.addWorklet('vumeter-out', 'js/audio/worklets/vol-meter.js', (ev) => {
updateAudioVisualizer(ev.data.volume);
});
Expand Down

0 comments on commit 857113a

Please sign in to comment.