Voice

This contains the source code documentation of the class subsystem_Voice.

subsystem_Voice

Inherits: DialogicSubsystem

Subsystem that manages setting voice lines for text events.

Description

It's recommended to use the DialogicVoiceEvent to set the voice lines for text events and not start playing them directly.

Properties


Methods

ReturnsMethod
floatget_remaining_time ( )
boolis_running ( )
boolis_voiced ( index: int )
voidpause ( )
voidplay_voice ( )
voidresume ( )
voidset_bus ( bus_name: String )
voidset_file ( path: String )
voidset_volume ( value: float )
voidstop_audio ( )

Signals

signal voiceline_finished ( info: Dictionary )

Emitted whenever a voice line finished playing. The info contains the following keys and values: Key | Value Type | Value ---------------- | ------------- | ----- file | String | The path to file played. remaining_time | float | The remaining time of the voiceline.


signal voiceline_started ( info: Dictionary )

Emitted whenever a new voice line starts playing. The info contains the following keys and values: Key | Value Type | Value -------- | ------------- | ----- file | String | The path to file played.


signal voiceline_stopped ( info: Dictionary )

Emitted whenever a voice line gets interrupted and does not finish playing. The info contains the following keys and values: Key | Value Type | Value ---------------- | ------------- | ----- file | String | The path to file played. remaining_time | float | The remaining time of the voiceline.


Property Descriptions

var current_audio_file

The current audio file being played.


var voice_player =

The audio player for the voiceline.


Method Descriptions

func get_remaining_time ( ) ⇒ float

Returns the remaining time of the current voice line in seconds. If there is no voice line playing, returns 0.


func is_running ( ) ⇒ bool

Whether there is still positive time remaining for the current voiceline.


func is_voiced ( index: int ) ⇒ bool

Whether the current event is a text event and has a voice event before it.


func pause ( ) ⇒ void

Stops the current voice from playing.


func play_voice ( ) ⇒ void

Plays the voice line. This will be invoked by Dialogic. Requires set_file to be called before or nothing plays.


func resume ( ) ⇒ void

Resumes a paused voice.


func set_bus ( bus_name: String ) ⇒ void

Set the voice player's bus to a bus_name.


func set_file ( path: String ) ⇒ void

Set a voice file path to be played, then invoke play_voice. This method does not check if path is a valid file.


func set_volume ( value: float ) ⇒ void

Set the volume to a value in decibels.


func stop_audio ( ) ⇒ void

Stops the current voice line from playing.