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

@wasm-audio-decoders/flac

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wasm-audio-decoders/flac

Web Assembly streaming FLAC decoder

  • 0.1.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
226K
increased by7.21%
Maintainers
1
Weekly downloads
 
Created

What is @wasm-audio-decoders/flac?

@wasm-audio-decoders/flac is an npm package that provides WebAssembly (WASM) based decoding for FLAC audio files. This allows for efficient and high-performance decoding of FLAC files directly in JavaScript environments, such as web browsers or Node.js.

What are @wasm-audio-decoders/flac's main functionalities?

Decode FLAC file to PCM

This feature allows you to decode a FLAC file into PCM (Pulse Code Modulation) data, which is a raw audio format. The code sample demonstrates how to read a FLAC file from the filesystem and decode it using the FlacDecoder class.

const { FlacDecoder } = require('@wasm-audio-decoders/flac');
const fs = require('fs');

async function decodeFlac() {
  const decoder = new FlacDecoder();
  const flacData = fs.readFileSync('path/to/your/file.flac');
  const pcmData = await decoder.decode(flacData);
  console.log(pcmData);
}
decodeFlac();

Stream FLAC file decoding

This feature allows you to decode a FLAC file in a streaming manner, which is useful for handling large files or streaming data. The code sample demonstrates how to create a read stream from a FLAC file and decode it chunk by chunk.

const { FlacDecoder } = require('@wasm-audio-decoders/flac');
const fs = require('fs');

async function streamDecodeFlac() {
  const decoder = new FlacDecoder();
  const readStream = fs.createReadStream('path/to/your/file.flac');
  for await (const chunk of readStream) {
    const pcmChunk = await decoder.decode(chunk);
    console.log(pcmChunk);
  }
}
streamDecodeFlac();

Other packages similar to @wasm-audio-decoders/flac

Keywords

FAQs

Package last updated on 22 Apr 2023

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