Skip to content

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

@yume-chan/pcm-player

Play raw audio sample stream using Web Audio API.

Features

  • [x] Arbitrary channel count
  • [x] Arbitrary sample rate
  • [x] Basic OLA (overlap-add) resampler
  • [ ] Adjustable buffer size

Usage

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 AudioContexts.

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


Assets

  • pcm-player-0.0.24.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0

Recent versions

View all