소스 검색

fix: set gain retroactively

Sv443 1 년 전
부모
커밋
095b53474e
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      lib/dom.ts

+ 1 - 1
lib/dom.ts

@@ -172,7 +172,7 @@ export function amplifyMedia<TElem extends HTMLMediaElement>(mediaElement: TElem
     gainNode: context.createGain(),
     /** Sets the gain of the amplifying GainNode */
     setGain(gain: number) {
-      props.gainNode.gain.setValueAtTime(gain, context.currentTime);
+      props.gainNode.gain.value = gain;
     },
     /** Returns the current gain of the amplifying GainNode */
     getGain() {