pcm-player 0.0.24
Install from the command line:
Learn more about npm packages
$ npm install @gasol/pcm-player@0.0.24
Install via package.json:
"@gasol/pcm-player": "0.0.24"
About this version
Play raw audio sample stream using Web Audio API.
- [x] Arbitrary channel count
- [x] Arbitrary sample rate
- [x] Basic OLA (overlap-add) resampler
- [ ] Adjustable buffer size
Depends on the sample format, there are multiple player classes:
-
Int16PcmPlayer
(little endian) Float32PcmPlayer
Float32PlanerPcmPlayer
No Planer
: audio samples are interleaved (left channel first).
With Planer
: audio samples are in a two-dimensional array (left channel first).
The constructors require user activation (must be invoked in a user event handler, e.g. onclick
), because they create AudioContext
s.
var player = Int16PcmPlayer(44100);
player.start();
player.feed(new Int16Array([0, 0, 0, 0, 0, 0, 0, 0]));
player.stop(); // `AudioContext` will be closed, so can't be restarted
Details
- pcm-player
- Gasol
- 5 months ago
- MIT
- 5 dependencies
Assets
- pcm-player-0.0.24.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0