Skip to content

Commit

Permalink
fix tyler
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Ireland committed Jun 9, 2017
1 parent fd90196 commit 8af9c4e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Talk.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function shiftAudioBuffer() {
var bufferToBePushed = currentBuffer;
audioBuffers.push(bufferToBePushed);
currentBuffer = audioContext.createBuffer(1, sampleFrames, sampleRate);

if(!playing) {
playing = true;
playAudio();
Expand All @@ -154,14 +154,14 @@ function shiftAudioBuffer() {
function playAudio() {
if (audioBuffers.length > 0) {
var source = audioContext.createBufferSource();

source.buffer = audioBuffers.shift();
source.connect(audioContext.destination);

source.onended = playAudio;
source.start();
} else {
setTimeout(playAudio(), bufferUnderflowSleepDurationMillis);
setTimeout(playAudio, bufferUnderflowSleepDurationMillis);
}
}

Expand Down

0 comments on commit 8af9c4e

Please sign in to comment.