interface AudioApi {
    onAudioLoaded$: Observable<undefined | AudioLoadedEvent>;
    onAudioSwitched$: Observable<AudioSwitchedEvent>;
    onMainAudioChange$: Observable<undefined | MainAudioChangeEvent>;
    onMainAudioPeakProcessorMessage$: Observable<
        AudioPeakProcessorMessageEvent,
    >;
    onSidecarAudioChange$: Observable<SidecarAudioChangeEvent>;
    onSidecarAudioCreate$: Observable<SidecarAudioCreateEvent>;
    onSidecarAudioPeakProcessorMessage$: Observable<
        SidecarAudioPeakProcessorMessageEvent,
    >;
    onSidecarAudioRemove$: Observable<SidecarAudioRemoveEvent>;
    activateSidecarAudioTracks(
        ids: string[],
        deactivateOthers: undefined | boolean,
    ): Observable<void>;
    createMainAudioPeakProcessor(
        audioMeterStandard?: AudioMeterStandard,
    ): Observable<Observable<AudioPeakProcessorMessageEvent>>;
    createMainAudioRouter(
        inputsNumber: number,
        outputsNumber?: number,
    ): Observable<OmpAudioRouterState>;
    createMainAudioRouterWithOutputsResolver(
        inputsNumber: number,
        outputsNumberResolver: (maxChannelCount: number) => number,
    ): Observable<OmpAudioRouterState>;
    createSidecarAudioPeakProcessor(
        sidecarAudioTrackId: string,
        audioMeterStandard?: AudioMeterStandard,
    ): Observable<Observable<AudioPeakProcessorMessageEvent>>;
    createSidecarAudioRouter(
        sidecarAudioTrackId: string,
        inputsNumber?: number,
        outputsNumber?: number,
    ): Observable<OmpAudioRouterState>;
    createSidecarAudioTrack(
        track: Partial<OmpAudioTrack>,
    ): Observable<OmpAudioTrack>;
    createSidecarAudioTracks(
        tracks: Partial<OmpAudioTrack>[],
    ): Observable<OmpAudioTrack[]>;
    deactivateSidecarAudioTracks(ids: string[]): Observable<void>;
    exportMainAudioTracksToSidecar(
        mainAudioTrackIds: string[],
    ): Observable<OmpAudioTrack[]>;
    exportMainAudioTrackToSidecar(
        mainAudioTrackId: string,
    ): Observable<OmpAudioTrack>;
    getActiveAudioTrack(): undefined | OmpAudioTrack;
    getActiveSidecarAudioTracks(): OmpAudioTrack[];
    getAudioContext(): AudioContext;
    getAudioTracks(): OmpAudioTrack[];
    getMainAudioRouter(): undefined | OmpAudioRouter;
    getMainAudioSourceNode(): AudioNode;
    getMainAudioState(): undefined | OmpMainAudioState;
    getSidecarAudio(id: string): undefined | SidecarAudioApi;
    getSidecarAudios(): SidecarAudioApi[];
    getSidecarAudioTracks(): OmpAudioTrack[];
    removeAllSidecarAudioTracks(): Observable<void>;
    removeSidecarAudioTracks(ids: string[]): Observable<void>;
    routeMainAudioRouterNodes(
        newAudioInputOutputNodes: AudioInputOutputNode[],
    ): Observable<void>;
    routeSidecarAudioRouterNodes(
        sidecarAudioTrackId: string,
        newAudioInputOutputNodes: AudioInputOutputNode[],
    ): Observable<void>;
    setActiveAudioTrack(id: string): Observable<void>;
}

Hierarchy (View Summary)

Properties

onAudioLoaded$: Observable<undefined | AudioLoadedEvent>

Fires on audio load. Initial value is undefined. Always emits the current value on subscription.

onAudioSwitched$: Observable<AudioSwitchedEvent>

Fires on audio track switched

onMainAudioChange$: Observable<undefined | MainAudioChangeEvent>

Fires when Main audio topology changes. For example, audio router is created.

onMainAudioPeakProcessorMessage$: Observable<AudioPeakProcessorMessageEvent>

Fires on Main audio peak processor message

onSidecarAudioChange$: Observable<SidecarAudioChangeEvent>

Fires when Sidecar audio topology changes. For example, audio router is created.

onSidecarAudioCreate$: Observable<SidecarAudioCreateEvent>

Fires when Sidecar audio is created

onSidecarAudioPeakProcessorMessage$: Observable<
    SidecarAudioPeakProcessorMessageEvent,
>

Fires on Sidecar audio peak processor message

onSidecarAudioRemove$: Observable<SidecarAudioRemoveEvent>

Fires when Sidecar audio is removed

Methods

  • Activates Sidecar audio tracks

    Parameters

    • ids: string[]

      Sidecar audio OmpAudioTrack.id array to activate

    • deactivateOthers: undefined | boolean

      Set to true if other sidecar audios should be deactivated

    Returns Observable<void>

  • Creates Main audio router

    Parameters

    • inputsNumber: number

      Number of inputs

    • OptionaloutputsNumber: number

      Number of outputs

    Returns Observable<OmpAudioRouterState>

  • Creates Main audio router

    Parameters

    • inputsNumber: number

      Number of inputs

    • outputsNumberResolver: (maxChannelCount: number) => number

      Function for resolving number of router outputs. Provides outputsNumberResolver.maxChannelCount as function input

    Returns Observable<OmpAudioRouterState>

  • Creates Sidecar audio router

    Parameters

    • sidecarAudioTrackId: string

      id Sidecar audio OmpAudioTrack.id

    • OptionalinputsNumber: number
    • OptionaloutputsNumber: number

    Returns Observable<OmpAudioRouterState>

  • Routes provided Main audio AudioInputOutputNode nodes

    Parameters

    • newAudioInputOutputNodes: AudioInputOutputNode[]

    Returns Observable<void>

  • Routes provided Sidecar audio AudioInputOutputNode nodes

    Parameters

    • sidecarAudioTrackId: string

      id Sidecar audio OmpAudioTrack.id

    • newAudioInputOutputNodes: AudioInputOutputNode[]

    Returns Observable<void>