Class Audio
Methods to manipulate audio.
Inherited Members
Namespace: GTA
Assembly: ScriptHookVDotNet3.dll
Syntax
public static class Audio
Methods
| Improve this Doc View SourceHasSoundFinished(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 |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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 |
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. |
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. |