import { HMSInternalEvent } from '../events/HMSInternalEvent'; import { HMSLocalAudioTrack } from '../internal'; export interface ITrackAudioLevelUpdate { track: HMSLocalAudioTrack; audioLevel: number; } export declare class TrackAudioLevelMonitor { private track; private audioLevelEvent; private silenceEvent; private readonly TAG; private audioLevel; private analyserNode?; private isMonitored; /** Frequency of polling audio level from track */ private interval; /** Store past audio levels for this duration */ private historyInterval; private history; constructor(track: HMSLocalAudioTrack, audioLevelEvent: HMSInternalEvent, silenceEvent: HMSInternalEvent<{ track: HMSLocalAudioTrack; }>); /** * To detect silence we check if the track is unmuted and silent in the current moment * periodically. If the track is found to be silent more than a threshold number of times * we send the event. The threshold number of time is there to reduce the chance of false * positives. */ detectSilence: () => Promise; start(): void; stop(): void; private loop; private sendAudioLevel; private getMaxAudioLevelOverPeriod; private calculateAudioLevel; private isSilentThisInstant; private createAnalyserNodeForStream; }