Skip to reading
PCA Script Programming

Gameplay: Audio, video, FMV and recorded gameplay

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Sound effects, music, voice and video use separate playback routes. A sound channel gives you a handle for stopping, pausing or fading a group of effects. Starting playback usually lets the next instruction run immediately.

play_sound()#

Play Sound | Action ID: PlaySound

Start an imported audio asset as a sound effect, optionally on a named channel.

Source table from Gameplay: Audio, video, FMV and recorded gameplay, page 193
Option key / fieldMeaning and accepted inputDefault
Sound Asset assetIdChoose an imported audio asset.Blank
Channel / ID channelSound-effect channel name. Reuse it to pause, stop or fade that sound group.Blank

Timing. The call waits for its runtime routine to return; no additional completion wait is promised by this schema.

Code example
play_sound({"assetId": "chime", "channel": "puzzle"})

In use. Play chime on puzzle, then continue the list. Use that same channel to stop or fade the effect later. A blank channel has broader/default behavior; name important continuing sounds.

Page 193 of 357Permalink
Go to page