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

ogg-opus-decoder

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ogg-opus-decoder

Web Assembly streaming Ogg Opus decoder

  • 1.6.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
310K
increased by1.19%
Maintainers
1
Weekly downloads
 
Created

What is ogg-opus-decoder?

The ogg-opus-decoder npm package is a JavaScript library that allows you to decode Ogg Opus audio files. It is useful for applications that need to handle audio streaming or playback in the browser or in Node.js environments.

What are ogg-opus-decoder's main functionalities?

Decoding Ogg Opus Files

This feature allows you to decode an Ogg Opus file and output the raw PCM data. The code sample demonstrates how to set up a stream to read an Ogg Opus file, decode it, and write the decoded PCM data to an output file.

const { OggOpusDecoder } = require('ogg-opus-decoder');
const fs = require('fs');

const decoder = new OggOpusDecoder();
const input = fs.createReadStream('path/to/your/file.ogg');
const output = fs.createWriteStream('path/to/output/file.pcm');

input.pipe(decoder).pipe(output);

Streaming Decoded Audio

This feature allows you to stream decoded audio directly to a speaker. The code sample demonstrates how to read an Ogg Opus file, decode it, and stream the audio to a speaker for playback.

const { OggOpusDecoder } = require('ogg-opus-decoder');
const fs = require('fs');
const Speaker = require('speaker');

const decoder = new OggOpusDecoder();
const input = fs.createReadStream('path/to/your/file.ogg');
const speaker = new Speaker({
  channels: 2,          // 2 channels (stereo)
  bitDepth: 16,         // 16-bit samples
  sampleRate: 48000     // 48,000 Hz sample rate
});

input.pipe(decoder).pipe(speaker);

Other packages similar to ogg-opus-decoder

Keywords

FAQs

Package last updated on 09 Oct 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