audio-correction
Audio stream correction utilities.
Installation
Install audio-correction
by running:
$ npm install --save audio-correction
Documentation
Stream audioCorrection.skew(Object options)
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.
options
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:
Speaker = require'speaker'Lame = require'lame'audioCorrection = require'audio-correction' decoder = # stream is an audio stream from somewhere streampipedecoder decoderon 'format' speaker = format decoder pipe audioCorrectionskew start: format: format maximumSkew: 300 : consolewarn"Error: Exceeds maximum skew of (ms.)" pipespeaker
Tests
Run the test suite by doing:
$ gulp test
TODO
- Improve unit testing in some areas of the code.
Contribute
We're looking forward to support more operating systems. Please raise an issue or even better, send a PR to increase support!
- Issue Tracker: github.com/resin-io/audio-correction/issues
- Source Code: github.com/resin-io/audio-correction
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ gulp lint
Support
If you're having any problem, please raise an issue on GitHub.
License
The project is licensed under the MIT license.