Name: audio-correction
Owner: Resin.io
Description: Audio stream correction utilities.
Created: 2015-02-20 20:27:43.0
Updated: 2016-11-14 00:22:19.0
Pushed: 2015-02-20 20:36:20.0
Homepage: null
Size: 132
Language: CoffeeScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Audio stream correction utilities.
Install audio-correction
by running:
m install --save audio-correction
Audio skew correction based on an specific date. It'll make sure an audio stream keeps playing on time.
Useful to keep multiple audio players in sync.
start
is a date representing the intended audio start time.format
is a PCM format object.maximumSkew
is a number (in milliseconds) representing the maximum skew allowed.onSkew(skew, maximumSkew)
is a function called when a skew occurs.Example:
ker = require('speaker')
= require('lame')
oCorrection = require('audio-correction')
der = new Lame.Decoder()
ream is an audio stream from somewhere
am.pipe(decoder)
der.on 'format', (format) ->
speaker = new Speaker(format)
decoder
.pipe audioCorrection.skew
start: new Date()
format: format
maximumSkew: 300
onSkew: (skew, maximumSkew) =>
console.warn("Error: Exceeds maximum skew of #{skew} (#{maximumSkew}ms.)")
.pipe(speaker)
Run the test suite by doing:
lp test
We're looking forward to support more operating systems. Please raise an issue or even better, send a PR to increase support!
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
lp lint
If you're having any problem, please raise an issue on GitHub.
The project is licensed under the MIT license.