Skip to content

Commit

Permalink
Fix Issue zz85#8: Incorrect pitch on mobile devices
Browse files Browse the repository at this point in the history
Make the "sampleRate" of the "AudioContext" and the "CircularAudioBuffer" matched.
  • Loading branch information
14725 authored Jan 23, 2021
1 parent 1800e92 commit 5b0db17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web_audio_player.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var emptyBuffer;
var audioIsInitted = false;

function initAudio() {
audioCtx = new window.AudioContext();
audioCtx = new window.AudioContext({sampleRate: 44100});
scriptNode = audioCtx.createScriptProcessor(BUFFER, 0, channels);
scriptNode.onaudioprocess = onAudioProcess;

Expand Down

0 comments on commit 5b0db17

Please sign in to comment.