Difference between revisions of "Lua:playSound"
Jump to navigation
Jump to search
m (moved playSound to Lua:playSound) |
(→Related Functions) |
||
| Line 52: | Line 52: | ||
=== Related Functions === | === Related Functions === | ||
| − | * [[findTableFile]] | + | * [[Lua:findTableFile|findTableFile]] |
| − | * [[Stream]] | + | |
| − | * [[FileStream]] | + | === Related Classes === |
| − | * [[MemoryStream]] | + | * [[Lua:Class:Stream|Stream]] |
| + | * [[Lua:Class:FileStream|FileStream]] | ||
| + | * [[Lua:Class:MemoryStream|MemoryStream]] | ||
Revision as of 00:54, 25 January 2018
function playSound(stream, waittilldone)
function playSound(tablefile, waittilldone)
Plays a sound file
Contents
Function Parameters
| Parameter | Type | Description |
|---|---|---|
| stream | Stream | A Stream object, can be MemoryStream or FileStream |
| tablefile | TableFile | A TableFile object, a file added and stored in the cheat table |
| waittilldone | Boolean | If true, the next LUA instruction will not execute until the sound is done playing |
Samples
Calling from LUA
playSound(findTableFile('protected.wav'))
Calling from an AA Script:
[enable]
luacall(playSound(findTableFile('protected.wav')))
globals+1034:
dd 1
[disable]
luacall(playSound(findTableFile('cleared.wav')))
globals+1034:
dd 2
Creating Files
I am unsure of the formats supported, but using Audacity worked for me. I recorded my microphone and selected just the portion I wanted, then used "File->Export Selected Audio" to export it as 'WAV (Microsoft) signed 16-bit PCM'.