Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

audio-correction

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

audio-correction

Audio stream correction utilities

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

audio-correction

npm version dependencies Build Status

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 = new Lame.Decoder()

# stream is an audio stream from somewhere
stream.pipe(decoder)

decoder.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)

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!

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.

Keywords

FAQs

Package last updated on 20 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc