1.0.0 • Published 1 month ago

@silyze/async-audio-format-webm v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

Async Audio Format WebM

Prebuilt WebM/Opus audio format for use with @silyze/async-audio-stream, powered by FFmpeg.

This package wraps @silyze/async-audio-ffmpeg and provides a ready-to-use AudioFormat for WebM/Opus encoding and decoding.


Install

npm install @silyze/async-audio-format-webm

Requires FFmpeg to be installed and available in your system PATH.


Usage

import { OpusFormat } from "@silyze/async-audio-format-webm";

// Create an instance for 8 kHz PCM audio
const format = new OpusFormat(8000);

console.log(format.name); // "webm-opus"
console.log(format.pcmSampleRate); // 8000

You can use this format directly with any system based on @silyze/async-audio-stream.


Available Formats

OpusFormat

WebM container with Opus audio codec.
Defaults to 24kbps mono output.

export const OpusFormat: new (sampleRate: number) => AudioFormat;
1.0.0

1 month ago