Search Results for

    Show / Hide Table of Contents

    Class Audio

    Methods to manipulate audio.

    Inheritance
    Object
    Audio
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: GTA
    Assembly: ScriptHookVDotNet3.dll
    Syntax
    public static class Audio

    Methods

    | Improve this Doc View Source

    HasSoundFinished(Int32)

    Gets a boolean indicating whether the specified sound instance has completed playing.

    Declaration
    public static bool HasSoundFinished(int id)
    Parameters
    Type Name Description
    Int32 id

    The identifier of the active sound effect instance.

    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    PlayMusic(String)

    Plays music from the game's music files.

    Declaration
    public static void PlayMusic(string musicFile)
    Parameters
    Type Name Description
    String musicFile

    The music file to play.

    | Improve this Doc View Source

    PlaySoundAt(Entity, String)

    Plays a sound from the game's sound files at the specified entity.

    Declaration
    public static int PlaySoundAt(Entity entity, string soundFile)
    Parameters
    Type Name Description
    Entity entity

    The entity to play the sound at.

    String soundFile

    The sound file to play.

    Returns
    Type Description
    Int32

    The identifier of the active sound effect instance.

    | Improve this Doc View Source

    PlaySoundAt(Entity, String, String)

    Plays a sound from the game's sound files at the specified entity.

    Declaration
    public static int PlaySoundAt(Entity entity, string soundFile, string soundSet)
    Parameters
    Type Name Description
    Entity entity

    The entity to play the sound at.

    String soundFile

    The sound file to play.

    String soundSet

    The name of the sound inside the file.

    Returns
    Type Description
    Int32

    The identifier of the active sound effect instance.

    | Improve this Doc View Source

    PlaySoundAt(Vector3, String)

    Plays a sound from the game's sound files at the specified position.

    Declaration
    public static int PlaySoundAt(Vector3 position, string soundFile)
    Parameters
    Type Name Description
    Vector3 position

    The world coordinates to play the sound at.

    String soundFile

    The sound file to play.

    Returns
    Type Description
    Int32

    The identifier of the active sound effect instance.

    | Improve this Doc View Source

    PlaySoundAt(Vector3, String, String)

    Plays a sound from the game's sound files at the specified position.

    Declaration
    public static int PlaySoundAt(Vector3 position, string soundFile, string soundSet)
    Parameters
    Type Name Description
    Vector3 position

    The world coordinates to play the sound at.

    String soundFile

    The sound file to play.

    String soundSet

    The name of the sound inside the file.

    Returns
    Type Description
    Int32

    The identifier of the active sound effect instance.

    | Improve this Doc View Source

    PlaySoundFrontend(String)

    Plays a sound from the game's sound files without transformation.

    Declaration
    public static int PlaySoundFrontend(string soundFile)
    Parameters
    Type Name Description
    String soundFile

    The sound file to play.

    Returns
    Type Description
    Int32

    The identifier of the active sound effect instance.

    | Improve this Doc View Source

    PlaySoundFrontend(String, String)

    Plays a sound from the game's sound files without transformation.

    Declaration
    public static int PlaySoundFrontend(string soundFile, string soundSet)
    Parameters
    Type Name Description
    String soundFile

    The sound file to play.

    String soundSet

    The name of the sound inside the file.

    Returns
    Type Description
    Int32

    The identifier of the active sound effect instance.

    | Improve this Doc View Source

    ReleaseSound(Int32)

    Releases the specified sound instance. Call this for every sound effect started.

    Declaration
    public static void ReleaseSound(int id)
    Parameters
    Type Name Description
    Int32 id

    The identifier of the active sound effect instance.

    | Improve this Doc View Source

    SetAudioFlag(AudioFlags, Boolean)

    Sets an audio flag to modify subsequent sounds.

    Declaration
    public static void SetAudioFlag(AudioFlags flag, bool toggle)
    Parameters
    Type Name Description
    AudioFlags flag
    Boolean toggle
    | Improve this Doc View Source

    StopMusic(String)

    Cancels playing a music file.

    Declaration
    public static void StopMusic(string musicFile)
    Parameters
    Type Name Description
    String musicFile

    The music file to stop.

    | Improve this Doc View Source

    StopSound(Int32)

    Cancels playing the specified sound instance.

    Declaration
    public static void StopSound(int id)
    Parameters
    Type Name Description
    Int32 id

    The identifier of the active sound effect instance.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX