setCinematicAudio
Client
Sets the sounds the cinematic plays during playback. It replaces the earlier sounds.
bool setCinematicAudio(cinematic cinematic, table cues)
Parameters
| Name | Type | Description |
|---|---|---|
| cinematic | cinematic | The cinematic. |
| cues | table | A list of sounds, in order of time. |
Returns
true if they were applied. false if the table is invalid, with a warning saying why.
Each sound plays as a sound element under the cinematic and has:
time: when it starts, in cinematic ms (required).sound: the path of a sound file in a resource (required).from: ms into the sound to start at.length: how much to play;0goes to the sound's end.fadeInandfadeOut: fade ms.volume: from 0 up, 1 by default.duck: the fraction of its volume, from 0 to 1, while an actor speaks. 1 by default.speed: from 0.1 to 10, 1 by default.actor: the actor that speaks the sound; its mouth moves with it.spatial: withactor,true(default) plays it from the actor's head,falseplays it unplaced.track: a number from 0 to 255 kept with the sound.
Example
local intro = createCinematic("cinematics/intro.cine")
setCinematicAudio(intro, {
{ time = 0, sound = "audio/theme.ogg", volume = 0.6, duck = 0.4, fadeOut = 2000 },
{ time = 3000, sound = "audio/hero_line1.ogg", actor = "hero" },
})