Search Results for

    Show / Hide Table of Contents

    Class Audio

    The audio service used for music and sound effects playback.

    Inheritance
    Audio
    Assembly: FlaxEngine.dll
    File: Engine/Audio/Audio.h
    Syntax
    public class Audio

    Fields

    ActiveDeviceChanged

    Event called when the active audio device gets changed.

    Declaration
    public static Action ActiveDeviceChanged
    Field Value
    Action

    DeviceAdded

    Event called when a new audio device is connected to the system.

    Declaration
    public static Action DeviceAdded
    Field Value
    Action

    DeviceRemoved

    Event called when an audio device is disconnected from the system.

    Declaration
    public static Action DeviceRemoved
    Field Value
    Action

    Devices

    The all audio devices.

    Declaration
    public static Array<AudioDevice> Devices
    Field Value
    Array<AudioDevice>

    DevicesChanged

    Event called when audio devices collection gets changed.

    Declaration
    public static Action DevicesChanged
    Field Value
    Action

    Listeners

    The audio listeners collection registered by the service.

    Declaration
    public static Array<AudioListener* > Listeners
    Field Value
    Array<AudioListener >

    Sources

    The audio sources collection registered by the service.

    Declaration
    public static Array<AudioSource* > Sources
    Field Value
    Array<AudioSource >

    Methods

    GetActiveDevice()

    Gets the active device.

    Declaration
    public static AudioDevice* GetActiveDevice()
    Returns
    AudioDevice

    The active device.

    GetActiveDeviceIndex()

    Gets the index of the active device. Returns -1 if set to system default mode.

    Declaration
    public static int32 GetActiveDeviceIndex()
    Returns
    int32

    The active device index.

    GetActiveDeviceResolvedIndex()

    Gets the resolved index in Devices array of the device currently playing (resolves system default mode to the actual device index).

    Declaration
    public static int32 GetActiveDeviceResolvedIndex()
    Returns
    int32

    The resolved active device index.

    GetEnableHRTF()

    Gets the preference to use HRTF audio (when available on platform). Default is true.

    Declaration
    public static bool GetEnableHRTF()
    Returns
    bool

    GetExplicitDeviceName()

    Gets the internal device name explicitly selected by the user (empty if using dynamic system default device).

    Declaration
    public static StringAnsi GetExplicitDeviceName()
    Returns
    StringAnsi

    GetMasterVolume()

    Gets the master volume applied to all the audio sources (normalized to range 0-1).

    Declaration
    public static float GetMasterVolume()
    Returns
    float

    The value

    GetVolume()

    Gets the actual master volume (including all side effects and mute effectors).

    Declaration
    public static float GetVolume()
    Returns
    float

    The final audio volume applied to all the listeners.

    SetActiveDeviceIndex(int32 index)

    Sets the index of the active device.

    Declaration
    public static void SetActiveDeviceIndex(int32 index)
    Parameters
    int32 index

    The index.

    SetActiveDeviceIndexSilent(int32 index)

    Sets the index of the active device without notifying backend.

    Declaration
    public static void SetActiveDeviceIndexSilent(int32 index)
    Parameters
    int32 index

    The index.

    SetDopplerFactor(float value)

    Sets the doppler effect factor. Scale for source and listener velocities. Default is 1.

    Declaration
    public static void SetDopplerFactor(float value)
    Parameters
    float value

    The value.

    SetEnableHRTF(bool value)

    Sets the preference to use HRTF audio (when available on platform). Default is true.

    Declaration
    public static void SetEnableHRTF(bool value)
    Parameters
    bool value

    The value.

    SetMasterVolume(float value)

    Sets the master volume applied to all the audio sources (normalized to range 0-1).

    Declaration
    public static void SetMasterVolume(float value)
    Parameters
    float value

    The value.

    SetSystemDefaultDeviceName(const StringAnsi& name)

    Sets the system default internal device name.

    Declaration
    public static void SetSystemDefaultDeviceName(const StringAnsi& name)
    Parameters
    StringAnsi name

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2026 Wojciech Figat