0.8.0 • Published 9 years ago

sonarvio-converter v0.8.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

js-standard-style

Sonarvio Converter

A wrapper for an emscripted version of ffmpeg to extract the audio tracks from media containers. It includes custom builds for 'wav'.

npm install --save sonarvio-converter

Features

  • minimal API surface for '.exec', '.info' and '.transform'
  • automatic queue system for scheduling re-used workers
  • transparent migration for usage with proxy for CORS handling

Usage

For a better integration with existing projects using webpack the actual script files for the workers are excluded. They have to be provided as an argument through the constructor.

// local
var Converter = require('sonarvio-converter')
var converter = new Converter({
	types: {
		webm: '<FILE_TO_WORKER_SCRIPT>' // e.g. require(file!ffmpeg.js/ffmpeg-worker-webm)
	}
})

converter.exec('webm', '-version').then(function(){
	console.log('shown infos');
})

converter.transform({
	name: 'example.webm',
	data: ....
}, {
	name: 'result.opus'
}).then(function (track) {
	console.log(track);
})

// remote
var Converter = require('sonarvio-converter')
var converter = new Converter({
	proxy: 'http://sonarvio.com/__/proxy.html'
})

converter.info('webm').then(function (info) {
	console.log(info);
})
0.8.0

9 years ago

0.6.0

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago