Difference between revisions of "GetSoundId"
From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"> <b>Command History</b> <div class="mw-collapsible-co...") |
|||
Line 6: | Line 6: | ||
− | + | Use this to store the sound.id for an audio file into a variable, which you can use for stopping/pausing said sound or editing the sounds properties! | |
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Syntax: | Syntax: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
− | + | getSoundId("filename") | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<syntaxhighlight> | <syntaxhighlight> | ||
− | -- | + | -- let's store the sound ID into a variable for later use! |
− | + | local soundID = getSoundId("sounds/example.ogg") | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 47: | Line 26: | ||
<b>filename</b>: path <br/> | <b>filename</b>: path <br/> | ||
− | The path to the audio file to | + | The path to the audio file whose ID we want to obtain! ("path/filename.type") |
<b><u>Flags</u></b> | <b><u>Flags</u></b> | ||
− | + | none | |
− | |||
− | |||
− | |||
− | |||
<b><u>Return</u></b> | <b><u>Return</u></b> | ||
− | + | <b>id</b> <br/> | |
− | {{i18n| | + | Returns the sound ID as an integer value. |
+ | {{i18n|GetSoundId}} <br/> | ||
{| style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%" | {| style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%" | ||
|- | |- | ||
|<b>Relevant Pages</b>: [[GetSoundProperty|getSoundProperty]] - [[SetSoundProperty|setSoundProperty]] - [[StartSound|startSound]] - [[StopSound|stopSound]] - [[ToggleSoundPause|toggleSoundPause]] | |<b>Relevant Pages</b>: [[GetSoundProperty|getSoundProperty]] - [[SetSoundProperty|setSoundProperty]] - [[StartSound|startSound]] - [[StopSound|stopSound]] - [[ToggleSoundPause|toggleSoundPause]] | ||
|} | |} |
Revision as of 22:36, 13 March 2013
Command History
Available since v3.8
Use this to store the sound.id for an audio file into a variable, which you can use for stopping/pausing said sound or editing the sounds properties!
Syntax:
getSoundId("filename")
-- let's store the sound ID into a variable for later use!
local soundID = getSoundId("sounds/example.ogg")
Arguments
filename: path
The path to the audio file whose ID we want to obtain! ("path/filename.type")
Flags
none
Return
id
Returns the sound ID as an integer value.
日本語 – 正體中文 – 한국어 – Dansk – Deutsch – English – Español – Français – Italiano – Nederlands – Polski – Português – Svenska – Русский |
Relevant Pages: getSoundProperty - setSoundProperty - startSound - stopSound - toggleSoundPause |