import { Observable } from 'rxjs'; import { ChatClientService } from '../chat-client.service'; import * as i0 from "@angular/core"; /** * fftSize * An unsigned integer, representing the window size of the FFT, given in number of samples. * A higher value will result in more details in the frequency domain but fewer details * in the amplitude domain. * * Must be a power of 2 between 2^5 and 2^15, so one of: 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, and 32768. * Defaults to 32. * * maxDecibels * A double, representing the maximum decibel value for scaling the FFT analysis data, * where 0 dB is the loudest possible sound, -10 dB is a 10th of that, etc. * The default value is -30 dB. * * minDecibels * A double, representing the minimum decibel value for scaling the FFT analysis data, * where 0 dB is the loudest possible sound, -10 dB is a 10th of that, etc. * The default value is -100 dB. */ export type AmplitudeAnalyserConfig = Pick; export type AmplitudeRecorderConfig = { analyserConfig: AmplitudeAnalyserConfig; sampleCount: number; samplingFrequencyMs: number; }; export declare const DEFAULT_AMPLITUDE_RECORDER_CONFIG: AmplitudeRecorderConfig; /** * The `AmplitudeRecorderService` is a utility service used to create amplitude values for voice recordings, making it possible to display a wave bar */ export declare class AmplitudeRecorderService { private chatService; config: AmplitudeRecorderConfig; amplitudes$: Observable; error$: Observable; private amplitudesSubject; private errorSubject; private audioContext; private analyserNode; private microphone; private stream; private amplitudeSamplingInterval; constructor(chatService: ChatClientService); /** * The recorded amplitudes */ get amplitudes(): number[]; /** * Start amplitude recording for the given media stream * @param stream */ start: (stream: MediaStream) => void; /** * Temporarily pause amplitude recording, recording can be resumed with `resume` */ pause(): void; /** * Resume amplited recording after it was pasued */ resume(): void; /** * Stop the amplitude recording and frees up used resources */ stop(): void; private init; private logError; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }