import { SimpleObservable } from "matrix-widget-api";
import EventEmitter from "events";
import { IDestroyable } from "../utils/IDestroyable";
export declare const SAMPLE_RATE = 48000;
export declare const RECORDING_PLAYBACK_SAMPLES = 44;
interface RecorderOptions {
    bitrate: number;
    encoderApplication: number;
}
export declare const voiceRecorderOptions: RecorderOptions;
export declare const highQualityRecorderOptions: RecorderOptions;
export interface IRecordingUpdate {
    waveform: number[];
    timeSeconds: number;
}
export declare enum RecordingState {
    Started = "started",
    EndingSoon = "ending_soon",// emits an object with a single numerical value: secondsLeft
    Ended = "ended",
    Uploading = "uploading",
    Uploaded = "uploaded"
}
export declare class VoiceRecording extends EventEmitter implements IDestroyable {
    private recorder?;
    private recorderContext?;
    private recorderSource?;
    private recorderStream?;
    private recorderWorklet?;
    private recorderProcessor?;
    private recording;
    private observable?;
    private targetMaxLength;
    amplitudes: number[];
    private liveWaveform;
    onDataAvailable?: (data: ArrayBuffer) => void;
    get contentType(): string;
    get durationSeconds(): number;
    get isRecording(): boolean;
    emit(event: string, ...args: any[]): boolean;
    disableMaxLength(): void;
    private shouldRecordInHighQuality;
    private makeRecorder;
    get liveData(): SimpleObservable<IRecordingUpdate>;
    get isSupported(): boolean;
    private onAudioProcess;
    private processAudioUpdate;
    /**
     * {@link https://github.com/chris-rudmin/opus-recorder#instance-fields ref for recorderSeconds}
     */
    get recorderSeconds(): number | undefined;
    start(): Promise<void>;
    stop(): Promise<void>;
    destroy(): void;
}
export {};
