UNPKG

@echogarden/wave-codec

Version:

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

17 lines (16 loc) 1.32 kB
import { RawAudio } from './utilities/Utilities.js'; 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 { float32ChannelsToBuffer, bufferToFloat32Channels } from './audio-utilities/AudioBufferConversion.js'; export { type BitDepth, type SampleFormat } from './WaveFormatHeader.js';