import type { SoundLayer, SoundVoice } from "./sound.sets.ts"; /** A seeded generator of numbers from 0 to 1 (mulberry32): the noise is the same every time. */ export declare function seeded(seed: number): () => number; /** The colours of noise: `white` flat, `pink` falling 3 dB an octave (a crowd's), `brown` falling 6 (a building's air). */ export type NoiseColour = "white" | "pink" | "brown"; /** Samples of noise of a colour, from a seed, between -1 and 1. */ export declare function noiseSamples(length: number, seed: number, colour?: NoiseColour): Float32Array; /** Samples of hands clapping: many short bursts of noise at random moments, `density` claps a second, for `length` samples at `rate`. */ export declare function applauseSamples(length: number, rate: number, seed: number, density?: number): Float32Array; /** Samples of people talking: noise whose level rises and falls with syllables, about four a second from each of many voices, summed. */ export declare function murmurSamples(length: number, rate: number, seed: number, voices?: number): Float32Array; /** A room's echo as an impulse response: noise falling 60 dB over `decay` seconds, two channels a little apart. */ export declare function impulseSamples(decay: number, rate: number, seed: number): [Float32Array, Float32Array]; /** A buffer of the context from samples (one channel, or two). */ export declare function bufferOf(context: BaseAudioContext, channels: readonly Float32Array[]): AudioBuffer; /** How many seconds each made layer loops for: long enough that the loop is not heard. */ export declare const LAYER_SECONDS = 6; /** * How much each made layer is turned down or up so that, through its filter, it is as loud as the demo's recordings are made (an RMS of -20 dBFS; the pool's water -22, and the building's air * a quiet -30): measured once in a browser by rendering each layer offline. */ export declare const LAYER_TRIM: Readonly>; /** The buffer a layer loops when it has no recording. */ export declare function layerBuffer(context: BaseAudioContext, layer: SoundLayer): AudioBuffer; /** The filter that shapes a made layer: the building's low air, water's hiss, talk's middle, a crowd's voice. */ export declare function layerFilter(context: BaseAudioContext, layer: SoundLayer): AudioNode; /** The loops a made voice is cut from, made the first time a voice needs one and kept by the caller. */ export interface VoiceBuffers { /** Pink noise. */ noise(): AudioBuffer; /** Hands clapping. */ applause(): AudioBuffer; } /** * Make a voice in the browser at `when` on the context's clock, into `out`, from the noise of `noise` (a pink loop). Returns when it ends. The horn is one chord held, never a tune; the * swell is not here, as it moves the bed's roar (the engine does it). */ export declare function makeVoice(context: BaseAudioContext, voice: Exclude, out: AudioNode, buffers: VoiceBuffers, when: number): number;