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

flac-tool.js

v1.3.2

Published

JavaScript FLAC (audio format) encoder and decoder (front-end package only)

Downloads

3

Readme

flac.js Build Status

JavaScript FLAC (audio format) de- and encoder

Project WebsiteMinimal demo

flac.js encodes or decodes whole files to FLAC, the Free Lossless Audio Codec. Supported input formats are wav, rf64, w64, aif, flac (flac in its native container as well as in oga/ogg). It is supposed to do the same as the flac executable that can be built from the FLAC sources.

This version of flac.js was built with Emscripten 1.37.20; flac 1.3.2; libogg 1.3.3

Building

If you just want to use flac.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/flac.js.git flac.js
cd flac.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.flac': {
		// MIME type
		'MIME': 'audio/flac'
	}
};

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 decoding) or prefetching the 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