export interface AudioConfig {
    sampleRate?: number;
    channels?: number;
    bufferSize?: number;
    disabled?: boolean;
    muted?: boolean;
}
export interface JitterBufferConfig {
    initialBuffer: number;
    minBuffer: number;
    maxBuffer: number;
    jitterMultiplier: number;
    shrinkRate: number;
}
export interface JitterBufferStats {
    jitter: number;
    targetBuffer: number;
    actualBuffer: number;
    underrunCount: number;
    chunkCount: number;
    avgChunkInterval: number;
    maxChunkInterval: number;
}
export declare enum AudioState {
    IDLE = "idle",
    PLAYING = "playing",
    PAUSED = "paused",
    STOPPED = "stopped"
}
export declare class AudioManager {
    private audioContext;
    private audioWorkletNode;
    private outputGainNode;
    private aecGainNode;
    private state;
    private config;
    private isInitialized;
    private initializingPromise;
    private mediaStreamDestination;
    private audioElement;
    private onPlaybackStartedHandler?;
    private onPlaybackEndedHandler?;
    private onPlaybackStoppedHandler?;
    private onBufferLowHandler?;
    private onErrorHandler?;
    private processorBlobUrl;
    private onAudioWaiting;
    private onAudioPlaying;
    private jitterConfig;
    private lastChunkArrivalTime;
    private lastChunkTimestamp;
    private jitterEstimate;
    private totalSamplesReceived;
    private chunkCount;
    private chunkIntervals;
    private maxChunkInterval;
    private targetBufferMs;
    private lastTargetUpdateTime;
    private workletStats;
    private isMobile;
    private isIOS;
    private workletConfig;
    private useAecOutput;
    private outputGain;
    private duckingTimer;
    private isChangingRate;
    private resampleSequence;
    private pendingResamples;
    private nextSendSequence;
    private isProcessingResample;
    private resampleLastSample;
    constructor(config?: AudioConfig);
    setRate(rate: number): Promise<void>;
    setFirstPlaybackBuffer(ms: number): void;
    setMuted(muted: boolean): Promise<void>;
    setOutputGain(value: number): void;
    duckOutput(tempGain: number, durationMs: number): void;
    setAecEnabled(enabled: boolean): Promise<void>;
    isAecEnabled(): boolean;
    isMobileDevice(): boolean;
    initialize(userGesture?: boolean): Promise<void>;
    private completeInitialization;
    private ensureFullyInitialized;
    private doEnsureFullyInitialized;
    playAudio(pcmData: ArrayBuffer): Promise<void>;
    appendAudio(pcmData: ArrayBuffer): Promise<void>;
    private resampleWithWebAudio;
    private resampleLinear;
    private processResampleQueue;
    resetResampleState(): void;
    private updateTargetBuffer;
    private getAverageChunkInterval;
    getJitterBufferStats(): JitterBufferStats;
    getChunkIntervalPercentiles(): {
        p50: number;
        p95: number;
        p99: number;
    };
    printJitterBufferReport(): void;
    resetJitterBuffer(preserveJitter?: boolean): void;
    stopPlayback(): void;
    clearBuffer(): void;
    notifyStreamStarted(): void;
    notifyStreamEnded(): void;
    getStats(): Promise<any>;
    getState(): AudioState;
    isPlaying(): boolean;
    enableAudio(): Promise<void>;
    isAudioEnabled(): boolean;
    dispose(): Promise<void>;
    onPlaybackStarted(handler: () => void): void;
    onPlaybackEnded(handler: () => void): void;
    onPlaybackStopped(handler: () => void): void;
    onBufferLow(handler: (remainingSamples: number) => void): void;
    onError(handler: (error: Error) => void): void;
    private handleWorkletMessage;
    private createProcessorBlobUrl;
    private getProcessorCode;
}
//# sourceMappingURL=AudioManager.d.ts.map