Lua:playSound

From Cheat Engine
Revision as of 03:58, 21 June 2026 by Leunsel (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
<> Function

function playSound(stream, waittilldone) : void

<> Function

function playSound(tablefile, waittilldone) : void

Plays a .WAV formatted sound from either a memory stream or a table file.

When a memory stream is provided, it must contain a .WAV formatted memory object. When a table file is provided, the memory stream stored inside the table file will be used and played.

If waittilldone is true, the script will stop executing until the sound has finished playing.

Cheat Engine provides two predefined table files named "Activate" and "Deactivate". These can be used directly or overridden.

Function Parameters[edit]

Parameter Type Description
stream MemoryStream A memory stream containing a .WAV formatted memory object.
tablefile TableFile A table file containing a memory stream that will be played as sound.
waittilldone Boolean (optional) If true, the script waits until the sound has finished playing before continuing execution.

Returns[edit]

void — This function does not return any value.

Examples[edit]

playSound(findTableFile("Activate"))

-- Wait until the sound has finished playing
playSound(findTableFile("Deactivate"), true)

See also[edit]

Lua
Script Engine