1.0.11 • Published 7 years ago

webaudio-wav-stream-player v1.0.11

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

webaudio-wav-stream-player

No latency wav stream player using fetch streaming API and WebAudio (Chrome-only)

npm license github-issues

Example : http://revolunet.github.io/webaudio-wav-stream-player

Usage

import WavPlayer from 'webaudio-wav-stream-player';

let player = new WavPlayer();
player.play('http//domain/path/to/stream.wav');
player.stop();

FAQ

  • you need CORS on the server streaming .wav

Example express proxy to add CORS header to some remote uri

// proxy /proxy/http://path/to/stream.wav

app.get('/proxy/*', function (req, res, next) {
  let remoteReq = request.get(req.params[0]);
  req.on("close", function() {
      remoteReq.abort();
      res.end();
  });
  req.pipe(remoteReq).pipe(res);
});

Inspiration : http://stackoverflow.com/questions/38589614/webaudio-streaming-with-fetch-domexception-unable-to-decode-audio-data/39988015#39988015

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago