소스 검색

Merge pull request #39037 from Faless/js/audio_latency

Fix JS audioContext parameters.
Rémi Verschelde 5 년 전
부모
커밋
ab3d7f29a8
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      platform/javascript/audio_driver_javascript.cpp

+ 2 - 2
platform/javascript/audio_driver_javascript.cpp

@@ -70,14 +70,14 @@ Error AudioDriverJavaScript::init() {
 	/* clang-format off */
 	_driver_id = EM_ASM_INT({
 		const MIX_RATE = $0;
-		const LATENCY = $1;
+		const LATENCY = $1 / 1000;
 		return Module.IDHandler.add({
 			'context': new (window.AudioContext || window.webkitAudioContext)({ sampleRate: MIX_RATE, latencyHint: LATENCY}),
 			'input': null,
 			'stream': null,
 			'script': null
 		});
-	});
+	}, mix_rate, latency);
 	/* clang-format on */
 
 	int channel_count = get_total_channels_by_speaker_mode(get_speaker_mode());