/** * Channel layout conversion. */ /** * Downmixes to a single channel. * * Averages rather than sums, so a stereo-to-mono conversion cannot clip. The * naive `L + R` overflows on anything approaching full scale and is a common * source of distortion in "convert to mono" features. */ export declare function toMono(channels: readonly Float32Array[]): Float32Array[]; /** Upmixes or downmixes to exactly two channels. */ export declare function toStereo(channels: readonly Float32Array[]): Float32Array[]; /** * Remaps channels by index. * * `mapChannels(audio, [0, 0])` duplicates the left channel to both sides; * `[1, 0]` swaps them. */ export declare function mapChannels(channels: readonly Float32Array[], mapping: readonly number[]): Float32Array[]; /** * Converts to `count` channels, choosing a sensible strategy. */ export declare function toChannelCount(channels: readonly Float32Array[], count: number): Float32Array[]; /** * Applies constant-power stereo panning. `position` runs -1 (left) to 1 (right). */ export declare function pan(channels: readonly Float32Array[], position: number): Float32Array[]; /** Splits into one single-channel buffer per channel. */ export declare function splitChannels(channels: readonly Float32Array[]): Float32Array[][]; /** Merges single-channel buffers into one multi-channel buffer. */ export declare function mergeChannels(buffers: ReadonlyArray): Float32Array[];