All Projects → samirkumardas → pcm-player

samirkumardas / pcm-player

Licence: other
A minimalist javascript audio player for PCM streaming audio

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to pcm-player

G711
PCM to G711 Fast Conversions
Stars: ✭ 39 (-80.6%)
Mutual labels:  pcm
pcm-convert
Convert pcm data from any to any format
Stars: ✭ 30 (-85.07%)
Mutual labels:  pcm
web-voice-processor
A library for real-time voice processing in web browsers
Stars: ✭ 69 (-65.67%)
Mutual labels:  pcm
Covid 19
COVID-19 Italia - Monitoraggio situazione
Stars: ✭ 3,886 (+1833.33%)
Mutual labels:  pcm
node-chiptune
Convert tracker music to PCM streams in Node.js (libopenmpt bindings)
Stars: ✭ 16 (-92.04%)
Mutual labels:  pcm
ANMP
multi-channel loopable video game music player for nerds and audiophiles
Stars: ✭ 16 (-92.04%)
Mutual labels:  pcm
PauseResumeAudioRecorder
An audio recorder that supports pause/resume functionality (WAV files only for now)
Stars: ✭ 19 (-90.55%)
Mutual labels:  pcm
opus-to-pcm
Decode raw opus packet to PCM without using any external library in your browser.
Stars: ✭ 47 (-76.62%)
Mutual labels:  pcm
simple-web-audio-recorder-demo
A simple HTML/JS demo that uses WebAudioRecorder.js to record audio on a web page
Stars: ✭ 141 (-29.85%)
Mutual labels:  pcm

PCM Player

A minimalist javascript audio player for PCM streaming data for the browsers.

How to use?

var player = new PCMPlayer(option);

Available options are:

encoding - possible values 8bitInt / 16bitInt / 32bitInt / 32bitFloat default: 16bitInt

channels - no of channels in PCM data

sampleRate - sample rate of the PCM data

flushingTime - flushing interval of PCM data to be played in milisecond. Default 1000ms

Decoder fire an event decode whenever it completes decoding. Usually it decodes several opus packet at a time for better performance although it need to be provided single opus packet into decode method.

Complete example:

var player = new PCMPlayer({
    encoding: '16bitInt',
    channels: 2,
    sampleRate: 8000,
    flushingTime: 2000
});

// Now feed PCM data into player getting from websocket or ajax whatever the transport you are using.
player.feed(pcm_data);

Available Methods

Name Parameter Remark
feed raw PCM data Usually get from ajax or websocket
volume decimal value 0 to 1 For controlling volume of the player
destroy - Destroy the player instance and release the resources

Compatibility

it is supported on:

  • Chrome for Android 34+
  • Chrome for Desktop 34+
  • Firefox for Android 41+
  • Firefox for Desktop 42+
  • IE11+ for Windows 8.1+
  • Edge for Windows 10+
  • Opera for Desktop
  • Safari for Mac 8+
  • Safari for iOS 8+

How to run example?

An example with simple node server script is available that include some raw pcm data that will be served by websocket and at the client end, it will be played through PCM player. For running the example, first run the node server by following command: (I am assuming you are on project directory i.e pcm-player)

cd example/server

node server.js

then, visit example/index.html page through any webserver.

If you don't have any web server, you can do following:

(I am assuming you are on project directory i.e pcm-player)

npm install http-server -g

then run following command

http-server

Finally visit example page using URL http://192.168.0.105:8081/example/index.html OR URL suggested by http-server

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].