Skip to main content

The "vngen_vox_play" Function

Syntax#

vngen_vox_play(name, sound, pitch_min, pitch_max, volume);
ArgumentTypeDescription
namestringThe ID of the speaking character to associate with this sound
soundsound/arrayThe sound resource to play
pitch_minreal (0-255)The minimum pitch multiplier, where 1 is default
pitch_maxreal (0-255)The maximum pitch multiplier, where 1 is default
volumereal (0-1)The sound volume, where 1 is default and 0 is silent

Description#

Unlike other sound actions, this script does not play a sound right away, but rather assigns a sound or array of sounds to be played whenever the specified character is speaking. This sound will be looped for the duration of the text typewriter effect to fill in for the absence of real voice audio. As such, it is recommended to use a brief 'blip' sound effect with this script. To further simulate a natural voice, pitch will be randomized between the min and max values each time text increments on the screen.

If multiple sounds are supplied in an array, a sound will be chosen at random each time text increments on the screen. Additional sounds can also be added or removed later with the vngen_vox_add and vngen_vox_remove functions.

Vox audio actions will be marked complete immediately and will not delay the next event until any fade transition is complete. Vox will be paused if vngen_toggle_pause is run.

Example#

if vngen_event() {
vngen_vox_play("John Doe", snd_blip, 0.75, 1.25, 1);
}