World of Warcraft Forever API · C_Sound.md, for your AI
C_Sound
6 functions, 2 events, 2 tables, as Blizzard documents them for Forever 1.60.1 (70959).
Making an addon with an AI? Tell it: Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it. It checks every call against this API before you try it in the game, then publishes it here. How it works.
Functions
C_Sound.GetSoundScaledVolume
scaledVolume = C_Sound.GetSoundScaledVolume(soundHandle)
Arguments
soundHandle | number |
|---|
Returns
scaledVolume | number |
|---|
C_Sound.IsPlaying
isPlaying = C_Sound.IsPlaying(soundHandle)
Arguments
soundHandle | number |
|---|
Returns
isPlaying | bool |
|---|
C_Sound.PlayItemSound
C_Sound.PlayItemSound(soundType, itemLocation)
Arguments
soundType | ItemSoundType | |
|---|---|---|
itemLocation | ItemLocation |
C_Sound.PlaySound
success, soundHandle = C_Sound.PlaySound(soundKitID, [uiSoundSubType], [forceNoDuplicates], [runFinishCallback], [overridePriority], [volumeOverride])
May return nothing.
Arguments
soundKitID | number | |
|---|---|---|
uiSoundSubType | UISoundSubType default "g_defaultSI3UISoundSubTypeForLua" | |
forceNoDuplicates | bool default false | |
runFinishCallback | bool default false | |
overridePriority | number may be nil | |
volumeOverride | number may be nil |
Returns
success | bool | |
|---|---|---|
soundHandle | SoundHandle |
C_Sound.PlaySoundWithOptions
success, soundHandle = C_Sound.PlaySoundWithOptions(params)
May return nothing.
Arguments
params | PlaySoundParams |
|---|
Returns
success | bool | |
|---|---|---|
soundHandle | SoundHandle |
C_Sound.PlayVocalErrorSound
C_Sound.PlayVocalErrorSound(vocalErrorSoundID)
Arguments
vocalErrorSoundID | Vocalerrorsounds |
|---|
Events
SOUND_DEVICE_UPDATE
No payload.
SOUNDKIT_FINISHED
soundHandle | number |
|---|
Tables
PlaySoundParams structure
soundKitID | number | |
|---|---|---|
uiSoundSubType | UISoundSubType default "g_defaultSI3UISoundSubTypeForLua" | |
forceNoDuplicates | bool default false | |
runFinishCallback | bool default false | |
overridePriority | number may be nil | |
volumeOverride | number may be nil |
PlaySoundResult structure
success | bool | |
|---|---|---|
soundHandle | SoundHandle |