# DO NOT EDIT THIS FILE!
#
# This code is generated off of PyCDP modules. If you need to make
# changes, edit the generator and regenerate all of the modules.

from __future__ import annotations
import typing

from ..context import get_connection_context, get_session_context

import cdp.web_audio
from cdp.web_audio import (
    BaseAudioContext,
    ContextChanged,
    ContextCreated,
    ContextDestroyed,
    ContextId,
    ContextRealtimeData,
    ContextState,
    ContextType
)


async def disable() -> None:
    '''
    Disables the WebAudio domain.
    '''
    session = get_session_context('web_audio.disable')
    return await session.execute(cdp.web_audio.disable())


async def enable() -> None:
    '''
    Enables the WebAudio domain and starts sending context lifetime events.
    '''
    session = get_session_context('web_audio.enable')
    return await session.execute(cdp.web_audio.enable())


async def get_realtime_data(
        context_id: ContextId
    ) -> ContextRealtimeData:
    '''
    Fetch the realtime data from the registered contexts.

    :param context_id:
    :returns: 
    '''
    session = get_session_context('web_audio.get_realtime_data')
    return await session.execute(cdp.web_audio.get_realtime_data(context_id))
