"""
        This module contains bindings to the C++ omni::audio::IAudioPlayer interface.
        This provides functionality for playing sound assets.  This is intended only
        as a basic audio player interface for previewing assets.  This is not intended
        to play sounds in a USD stage or in the Kit UI.  For sounds in the USD stage,
        the omni.usd.audio interface should be used instead.  For UI sounds, the
        omni.kit.uiaudio interface should be used.

        Sound files may be in RIFF/WAV, Ogg, or FLAC format.
        Data in the sound files may use 8, 16, 24, or 32 bit integer samples,
        or 32 bit floating point samples.  Channel counts may be from 1 to 64
        If more channels of data are provided than the audio device can play,
        some channels will be blended together automatically.
    """
from __future__ import annotations
import omni.audioplayer._audioplayer
import typing
import carb._carb
import carb.events._events

__all__ = [
    "AudioPlayer",
    "CallbackType",
    "FLAG_FORCE_RELOAD",
    "FLAG_RAW_DATA",
    "RawPcmFormat",
    "create_audio_player"
]


class AudioPlayer():
    """
    An individual audio player instance.
    This must be created in order to have something to play sounds from.
    """
    def draw_waveform(self, width: int, height: int, fgColor: carb._carb.Float4, bgColor: carb._carb.Float4) -> typing.List[int]: 
        """
        Render the waveform to an image to a buffer.

        The functionality of writing to a file is a temporary workaround.
        This will eventually be changed to output a memory buffer.

         Args:
             width    The width of the output image, in pixels.
             height   The height of the output image, in pixels.
             fgColor  The foreground color in normalized RGBA color.
             bgColor  The background color in normalized RGBA color.

         Returns:
             A list containing the raw RGBA8888 values for the image.
             An empty array on failure.
        """
    def draw_waveform_to_file(self, filename: str, width: int, height: int, fgColor: carb._carb.Float4, bgColor: carb._carb.Float4) -> bool: 
        """
        Render the waveform to an image to a file.

        The functionality of writing to a file is a temporary workaround.
        This will eventually be changed to output a memory buffer.

         Args:
             filename The name for the output image file.
             width    The width of the output image, in pixels.
             height   The height of the output image, in pixels.
             fgColor  The foreground color in normalized RGBA color.
             bgColor  The background color in normalized RGBA color.

         Returns:
             True if the operation was successful.
             False if the file could not be generated.
        """
    def get_event_stream(self) -> carb.events._events.IEventStream: 
        """
        Get a reference to the IEventStream for this audio player instance

        The following event types will be sent:
            CallbackType.LOADED when the requested audio has finished loading.
            CallbackType.ENDED when the requested audio has finished playing.

        You should remove your settings subscription before shutting down your
        audio player, since events are sent asynchronously, so you could get an
        event after your player has been destroyed.

        Returns:
            The IEventStream for the audio player.
        """
    def get_play_cursor(self) -> float: 
        """
        Get the play cursor position in the currently playing sound.

        Args:
            No arguments

        Returns:
             The play cursor position in the currently playing sound in seconds.

             0.0 if there is no playing sound.
        """
    def get_sound_length(self) -> float: 
        """
        Get the length of the currently playing sound.

        Args:
            No arguments

        Returns:
            The length of the currently playing sound in seconds.

            0.0 if there is no playing sound.
        """
    def load_sound(self, path: str) -> None: 
        """
        Load a sound asset for future playback.

        This will fetch an asset so that the next call to play_sound()
        can begin playing the sound immediately.
        This will also stop the currently playing sound, if any.
        This function will also cause get_sound_length() to begin
        returning the length of this sound.

        This will send a CallbackType.LOADED when the asset has loaded.

        Args:
            path:       The string path to the sound asset to play.
                        This must be an absolute file path to a sound asset.
            startTime:  The time offset, in seconds, to begin playing this
                        sound at.

        Returns:
            No return value.
        """
    def load_sound_in_memory(self, name: str, bytes: str, frame_rate: int = 0, channels: int = 0, format: RawPcmFormat = RawPcmFormat.PCM_16, flags: int = 0) -> None: 
        """
        Loads a sound asset from a blob in memory for future playback.

        The sound asset will not start playing when the asset has loaded.
        It will however be cached so that a later request with the same
        data and name can play the sound.  The asset is given as a data
        blob in memory as a `bytes` object.  The data may either be a full
        file loaded into memory or just raw PCM data.  If raw PCM data is
        given, additional parameters must be used to specify the sample
        type, channel count, and frame rate so that the data can be
        successfully decoded.

        Args:
            name:       The name to give to this asset.  This is only used
                        for caching purposes so the sound can be played
                        multiple times without having to reload it.
                        This must not be `None` or an empty string otherwise
                        the operation will just be ignored.
            bytes:      The `bytes` object that contains the data for the
                        sound.  This is treated as a single binary blob of
                        data.  This may not be `None`.
            frame_rate: The frame rate to play the sound data at.  If the
                        binary blob contains format information, this is
                        ignored.  This is only needed if the `FLAG_RAW_DATA`
                        flag is specified in `flags`.
            channels:   The number of channels in each frame of the sound
                        data.  If the binary block contains format information,
                        this can be ignored.  This is only needed if the
                        `FLAG_RAW_DATA` flag is specified in `flags`.
            format:     The format of each sample of data.  This must be
                        one of the `RawPcmFormat` values.  This is only used
                        if the blob does not already contain format information.
            flags:      Flags to control how the sound data is loaded and cached.
                        If the data blob does not contain format information and
                        is just raw PCM sample data, the `FLAG_RAW_DATA` flag must be
                        specified and the `frame_rate`, `channels`, and `format`
                        arguments must also be given.  Without these, the sound
                        data cannot be properly loaded.

        Returns:
            No return value.
        """
    def pause_sound(self) -> None: 
        """
        Pause playback of a sound on a specific audio player.

        Each player has only one voice, so this call pauses that voice.

        Args:
            No arguments

        Returns:
            No return value.
        """
    def play_sound(self, path: str, startTime: float = 0.0) -> None: 
        """
        Play a sound asset.

        The sound asset will start playing asynchronously when the asset has
        loaded.

        Args:
            path:       The string path to the sound asset to play.
                        This must be an absolute file path to a sound asset.
            startTime:  The time offset, in seconds, to begin playing this
                        sound at.

        Returns:
            No return value.
        """
    @staticmethod
    def play_sound_in_memory(*args, **kwargs) -> typing.Any: 
        """
        Play a sound asset from data in memory.

        The sound asset will start playing asynchronously when the asset has
        loaded.  The asset is given as a data blob in memory as a `bytes`
        object.  The data may either be a full file loaded into memory or
        just raw PCM data.  If raw PCM data is given, additional parameters
        must be used to specify the sample type, channel count, and frame
        rate so that the data can be successfully decoded.

        Args:
            name:       The name to give to this asset.  This is only used
                        for caching purposes so the sound can be played
                        multiple times without having to reload it or so
                        it can be preloaded with load_sound_in_memory().
                        Set this to `None` or an empty string to disable
                        caching the sound and just play it.  Note that if
                        the `FLAG_FORCE_RELOAD` flag is used, the cache check
                        will be ignored and the sound will be loaded and
                        cached again.
            bytes:      The `bytes` object that contains the data for the
                        sound.  This is treated as a single binary blob of
                        data.  This may not be `None`.
            frame_rate: The frame rate to play the sound data at.  If the
                        binary blob contains format information, this is
                        ignored.  This is only needed if the `FLAG_RAW_DATA`
                        flag is specified in `flags`.
            channels:   The number of channels in each frame of the sound
                        data.  If the binary block contains format information,
                        this can be ignored.  This is only needed if the
                        `FLAG_RAW_DATA` flag is specified in `flags`.
            format:     The format of each sample of data.  This must be
                        one of the `RawPcmFormat` values.  This is only used
                        if the blob does not already contain format information.
            startTime:  The time offset, in seconds, to begin playing this
                        sound at.
            flags:      Flags to control how the sound data is loaded and cached.
                        If the data blob does not contain format information and
                        is just raw PCM sample data, the `FLAG_RAW_DATA` flag must be
                        specified and the `frame_rate`, `channels`, and `format`
                        arguments must also be given.  Without these, the sound
                        data cannot be properly loaded.

        Returns:
            No return value.
        """
    def set_play_cursor(self, startTime: float = 0.0) -> None: 
        """
        Set the play cursor position in the currently playing sound.

        Args:
            startTime:  The time to set the cursor to in the sound.

        Returns:
            No return value.
        """
    def stop_sound(self) -> None: 
        """
        Immediately stops the playback on a specific audio player

        Each player has only one voice, so this call stops that voice.

        Args:
            No arguments

        Returns:
            No return value.
        """
    def unpause_sound(self) -> None: 
        """
        Unpause playback of a sound on a specific audio player.

        Each player has only one voice, so this call unpauses that voice.
        If no voice is paused, this does nothing.

        Args:
            No arguments

        Returns:
            No return value.
        """
    pass
class CallbackType():
    """
    Members:

      LOADED

      ENDED
    """
    def __eq__(self, other: object) -> bool: ...
    def __getstate__(self) -> int: ...
    def __hash__(self) -> int: ...
    def __index__(self) -> int: ...
    def __init__(self, value: int) -> None: ...
    def __int__(self) -> int: ...
    def __ne__(self, other: object) -> bool: ...
    def __repr__(self) -> str: ...
    def __setstate__(self, state: int) -> None: ...
    @property
    def name(self) -> str:
        """
        :type: str
        """
    @property
    def value(self) -> int:
        """
        :type: int
        """
    ENDED: omni.audioplayer._audioplayer.CallbackType # value = <CallbackType.ENDED: 1>
    LOADED: omni.audioplayer._audioplayer.CallbackType # value = <CallbackType.LOADED: 0>
    __members__: dict # value = {'LOADED': <CallbackType.LOADED: 0>, 'ENDED': <CallbackType.ENDED: 1>}
    pass
class RawPcmFormat():
    """
    Members:

      PCM_8 : Provided raw 8-bit unsigned PCM data.

      PCM_16 : Provided raw 16-bit signed PCM data.

      PCM_32 : Provided raw 32-bit signed PCM data.

      PCM_FLOAT : Provided raw 32-bit floating point PCM data.
    """
    def __eq__(self, other: object) -> bool: ...
    def __getstate__(self) -> int: ...
    def __hash__(self) -> int: ...
    def __index__(self) -> int: ...
    def __init__(self, value: int) -> None: ...
    def __int__(self) -> int: ...
    def __ne__(self, other: object) -> bool: ...
    def __repr__(self) -> str: ...
    def __setstate__(self, state: int) -> None: ...
    @property
    def name(self) -> str:
        """
        :type: str
        """
    @property
    def value(self) -> int:
        """
        :type: int
        """
    PCM_16: omni.audioplayer._audioplayer.RawPcmFormat # value = <RawPcmFormat.PCM_16: 1>
    PCM_32: omni.audioplayer._audioplayer.RawPcmFormat # value = <RawPcmFormat.PCM_32: 2>
    PCM_8: omni.audioplayer._audioplayer.RawPcmFormat # value = <RawPcmFormat.PCM_8: 0>
    PCM_FLOAT: omni.audioplayer._audioplayer.RawPcmFormat # value = <RawPcmFormat.PCM_FLOAT: 3>
    __members__: dict # value = {'PCM_8': <RawPcmFormat.PCM_8: 0>, 'PCM_16': <RawPcmFormat.PCM_16: 1>, 'PCM_32': <RawPcmFormat.PCM_32: 2>, 'PCM_FLOAT': <RawPcmFormat.PCM_FLOAT: 3>}
    pass
def create_audio_player(*args, **kwargs) -> typing.Any:
    pass
FLAG_FORCE_RELOAD = 2
FLAG_RAW_DATA = 1
