UNPKG

@100mslive/hms-video-store

Version:

@100mslive Core SDK which abstracts the complexities of webRTC while providing a reactive store for data management with a unidirectional data flow

47 lines (46 loc) 1.9 kB
import { HMSAudioPlugin } from './HMSAudioPlugin'; import { EventBus } from '../../events/EventBus'; import { HMSLocalAudioTrack } from '../../media/tracks'; import Room from '../../sdk/models/HMSRoom'; /** * This class manages applying different plugins on a local audio track. Plugins which need to modify the audio * are called in the order they were added. Plugins which do not need to modify the audio are called * with the original input. * * Concepts - * Audio Plugin - A module which can take in input audio, do some processing on it and return an AudioNode * * For Each Plugin, an AudioNode will be created and the source will be created from local audio track. * Each Audio node will be connected in the following order * source -> first plugin -> second plugin -> third plugin .. so on * @see HMSAudioPlugin */ export declare class HMSAudioPluginsManager { private eventBus; private readonly TAG; private readonly hmsTrack; readonly pluginsMap: Map<string, HMSAudioPlugin>; private audioContext?; private sourceNode?; private destinationNode?; private prevAudioNode?; private analytics; private outputTrack?; private pluginAddInProgress; private room?; constructor(track: HMSLocalAudioTrack, eventBus: EventBus, room?: Room); getPlugins(): string[]; addPlugin(plugin: HMSAudioPlugin): Promise<void>; private addPluginInternal; validatePlugin(plugin: HMSAudioPlugin): import("./HMSAudioPlugin").HMSPluginSupportResult; validateAndThrow(name: string, plugin: HMSAudioPlugin): Promise<void>; removePlugin(plugin: HMSAudioPlugin): Promise<void>; cleanup(): Promise<void>; closeContext(): Promise<void>; reprocessPlugins(): Promise<void>; private initAudioNodes; private updateProcessedTrack; private processPlugin; private connectToDestination; private removePluginInternal; }