UNPKG

@echogarden/wave-codec

Version:

A fully-featured WAVE format encoder and decoder. Written in pure TypeScript.

20 lines (19 loc) 1.3 kB
import { BitDepth, SampleFormat } from './WaveFormatHeader.js'; export declare function encodeWaveFromFloat32Channels(audioChannels: Float32Array[], sampleRate: number, bitDepth?: BitDepth, sampleFormat?: SampleFormat, speakerPositionMask?: number): Uint8Array<ArrayBufferLike>; export declare function encodeWaveFromBuffer(audioBuffer: Uint8Array, sampleRate: number, channelCount: number, bitDepth: BitDepth, sampleFormat: SampleFormat, speakerPositionMask?: number): Uint8Array<ArrayBufferLike>; export declare function decodeWaveToFloat32Channels(waveData: Uint8Array, ignoreTruncatedChunks?: boolean, ignoreOverflowingDataChunks?: boolean): RawAudio; export declare function decodeWaveToBuffer(waveData: Uint8Array, ignoreTruncatedChunks?: boolean, ignoreOverflowingDataChunks?: boolean): { decodedAudioBuffer: Uint8Array<ArrayBufferLike>; sampleRate: number; channelCount: number; bitDepth: BitDepth; sampleFormat: SampleFormat; speakerPositionMask: number; }; export declare function repairWaveData(waveData: Uint8Array): Uint8Array<ArrayBufferLike>; export * from './audio-utilities/AudioBufferConversion.js'; export { type BitDepth, SampleFormat } from './WaveFormatHeader.js'; export type RawAudio = { audioChannels: Float32Array[]; sampleRate: number; };