Skip to content

Commit

Permalink
Merge pull request #208 from chris-rudmin/fixDecoderExample
Browse files Browse the repository at this point in the history
Fix decoder example
  • Loading branch information
chris-rudmin authored Jun 6, 2020
2 parents f3fe542 + 5284688 commit 497402e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions example/decoder.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ <h2>Recordings</h2>
function decodeOgg(arrayBuffer){

var typedArray = new Uint8Array(arrayBuffer);
var decoderWorker = new Worker('../dist-unminified/decoderWorker.js');
var wavWorker = new Worker('../dist-unminified/waveWorker.js');
var decoderWorker = new Worker('../dist/decoderWorker.min.js');
var wavWorker = new Worker('../dist/waveWorker.min.js');
var desiredSampleRate = parseInt(sampleRate.value,10);

decoderWorker.postMessage({
Expand Down Expand Up @@ -75,11 +75,10 @@ <h2>Recordings</h2>
};

wavWorker.onmessage = function(e){

// null signifies that no more data is expected and worker is closed.
if (e.data !== null) {

if (e.data.message === "page") {
var fileName = new Date().toISOString() + ".wav";
var dataBlob = new Blob( [ e.data ], { type: "audio/wav" } );
var dataBlob = new Blob( [ e.data.page ], { type: "audio/wav" } );
var url = URL.createObjectURL( dataBlob );

var audio = document.createElement('audio');
Expand Down

0 comments on commit 497402e

Please sign in to comment.