npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

opusenc.js

v0.1.10

Published

JavaScript Opus (audio format) Encoder (front-end package only)

Downloads

16

Readme

opusenc.js Build Status

JavaScript Opus (audio format) Encoder

Project WebsiteMinimal demo

Opusenc.js encodes whole files to ogg-opus; this is Opus encapsulated into an Ogg container. It is supposed to do the same as the opusenc tool from the opus-tools collection and as such supports features like Vorbis comment, preserving some metadata, reading AIF, WAV, and FLAC (in its native container).

This version of opusenc.js was built with Emscripten 1.37.20; flac 1.3.2; libogg 1.3.3; opus v1.2.1; opus-tools v0.1.10

If the browser supports WebAssembly, that is used although it might be even slower and produce larger files compared to asm.js created files. The reason is currently investigated on; if you know, please enlight me.

Building

If you just want to use opusenc.js, you don't have to build it. In this case, see using instead.

Prerequisites

  • A recent linux build system
  • Emscripten installed and activated

Build script

git clone --recursive git://github.com/Rillke/opusenc.js.git opusenc.js
cd opusenc.js
./make.sh

Using

A pre-compiled script together with some auxiliary scripts making use from JavaScript easier is in the /worker directory. iframe.html is a minimal usage example. Test it live. It starts the encoding process posting command: 'encode' to the worker:

var worker = new Worker( 'worker/EmsWorkerProxy.js' );
// Files to be read and posted back
// after encoding completed
var outData = {
	// File name
	'encoded.opus': {
		// MIME type
		'MIME': 'audio/ogg'
	}
};

worker.onmessage = function( e ) {
	// Handle incoming data
};

// Prepare files etc.

// Post all data and the encode command
// to the web worker
worker.postMessage( {
	command: 'encode',
	args: args,
	outData: outData,
	fileData: storedFiles
} );
  • command: 'encode'|'prefetch' DOMString that either starts encoding or prefetching the 850 KiB worker script. Posting a prefetch command in advance is optional, depends on the user experience you'd like to create and does not require further arguments. If the script is not prefetched, it will be downloaded when 'encode' is invoked.
  • args: Array holding the command line arguments (DOMString)
  • outData: Object literal of information about the files that should be read out of the worker's file system after encoding completed
  • fileData: Object literal of input file data mapping file names to Uint8Arrays

A more extensive example is available on the project's website.

Contributing

Submit patches to this GitHub repository or file issues.

License

See LICENSE.md

Open source Opus JS ports

| Implementation | Primary focus | Implementation details | | -------------- |:-------------:| ----------------------:| | opusenc.js | JS-Port of the opusenc command line tool (encoding from and to files); encoding larger but not huge chunks of audio to Ogg-Opus files, showcase/Opus evangelism | Written in JS; Emscripten hybrid WASM with asm.js fallback; building on Xiph.org's opusenc (which is part of opus tools) | | opus.js-sample | De-, encoder and resampler for raw Opus (without container) | Written in Typescript; Web-Worker; codec and resampler ported with Emscripten to asm.js; building on Xiph.org's reference implementation of opus en-/decoder | | opus-recorder | Recorder (audio source like microphone); Ogg-Opus de-and encoder and resampler | Custom Ogg implementation purely in JS; npm and bower packaging; building on Xiph.org's reference implementation of opus and speexdsp; new versions WASM-only; Old versions asm.js-only | | audiocogs/opus.js | Modular system decoding and playing Ogg-Opus as well as a lot of other audio formats (any if an appropriate plugin is available) | aurora.js (CoffeeScript) plugin; building on Xiph.org's reference implementation of opus; npm packaging; asm.js which is not labeled as such | | howler.js | Audio playback shim with special effects (probably good for games) | Pure JavaScript; no Opus support compiled into; uses browser APIs for decoding and playback | | opus-stream.js | Opus streaming solution with de-/encoding and resampling support offering raw and packaged streaming with adjustable buffer sizes; server-side example component | Emscripten hybrid WASM with asm.js fallback, npm and bower packaging |

Losless audio codec required?

Try flac.js.