Difference between revisions of "Lua:playSound"

From Cheat Engine
Jump to navigation Jump to search
m (Created page with 'If you wish to play [http://www.freeslotsland.eu/ Real Money Free Slots], the one thing that you're going to need to be careful about is the fact that you have to ensure that you…')
 
m (Syntax Highlighting.)
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
If you wish to play [http://www.freeslotsland.eu/ Real Money Free Slots], the one thing that you're going to need to be careful about is the fact that you have to ensure that you have a smart phone which is going to be appropriate making use of Best Free Slots Online and can not freeze once in a while.
+
[[Category:Lua]]
 +
{{CodeBox|'''function''' playSound(''stream'', ''waittilldone'') ''':''' void}}
 +
{{CodeBox|'''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===
 +
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 +
!align="left"|Parameter
 +
!align="left"|Type
 +
!style="width: 80%;background-color:white;" align="left"|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===
 +
void — This function does not return any value.
 +
 
 +
===Examples===
 +
<syntaxhighlight lang="lua" line>
 +
playSound(findTableFile("Activate"))
 +
 
 +
-- Wait until the sound has finished playing
 +
playSound(findTableFile("Deactivate"), true)
 +
</syntaxhighlight>
 +
 
 +
{{LuaSeeAlso}}

Latest revision as of 20:18, 25 June 2026

<> Lua API Reference

function playSound(stream, waittilldone) : void

<> Lua API Reference

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]

1 playSound(findTableFile("Activate"))
2 
3 -- Wait until the sound has finished playing
4 playSound(findTableFile("Deactivate"), true)

Main Pages

Core Lua documentation entry points

Lua
Script Engine