Skip to content

CutAudio beta ​

Class of @v12-engine/client

ts
export declare class CutAudio

Sound as a script drives it (cut.audio): see the top of this file

Members ​

constructor ​

ts
constructor(cut: Cut);

Constructs a new instance of the CutAudio class

music ​

ts
music(tracks: string | string[] | null, options?: {
        crossfade?: number;
        volume?: number;
    }): CutMusic | undefined;

Music: tracks played one after the other, faded in over crossfade seconds (1) as the music before fades out; null for none. Gives back the music as code reaches it (musicNow)

musicNow ​

ts
musicNow(): CutMusic | undefined;

The music playing, as code reaches it: its <audio> element, its volume's node, the context. None for none

musicVolume ​

ts
musicVolume(level: number, seconds?: number): void;

The music's own volume (0 to 1), eased over seconds

reset ​

ts
reset(seconds?: number): void;

The music and the volumes as they were, over seconds: when the cinematic is over

sound ​

ts
sound(name: string, options?: CutSoundOptions): CutSound | undefined;

A sound of the game's: at a spot or on a unit (heard from where the camera is), or as it is; shaped as options say. One on a unit follows it (CN52): put where it is every frame for as long as it plays (CutSound.at), where it last was once it is gone

stinger ​

ts
stinger(name: string, options?: number | SoundShape): CutSound | undefined;

A short piece of music at this moment, over the music playing (on the music bus): at a volume, or shaped. Gives back what code reaches of it while it plays (none where nothing is heard: no file, the page not clicked yet)

voice ​

ts
voice(name: string, options?: number | SoundShape): CutSound | undefined;

A voice: a recording of the game's, on the voice bus (the music and the ambience duck under it)

volume ​

ts
volume(bus: Bus, level: number, seconds?: number): void;

A bus at level of the player's volume for it (1 as they set it), eased over seconds