GKVoiceChat

Inherits: RefCounted < Object

Represents a Game Center voice chat channel.

Description

Use GKMatch.voice_chat() to open a voice channel for a realtime match, then call start() / stop() and monitor player_state_changed.

Properties

bool

is_active

false

String

name

""

Array

players

[]

float

volume

0.0

Methods

bool

is_voip_allowed() static

void

set_player_muted(player: GKPlayer, muted: bool)

void

start()

void

stop()


Signals

player_state_changed(player: GKPlayer, state: int) 🔗

Emitted when a player’s voice chat state changes. state uses Apple’s raw GKVoiceChat.PlayerState value.


Property Descriptions

bool is_active = false 🔗

  • void set_is_active(value: bool)

  • bool get_is_active()

Whether this voice chat is currently active.


String name = "" 🔗

  • String get_name()

Channel name.


Array players = [] 🔗

  • Array get_players()

Players currently participating in the channel.


float volume = 0.0 🔗

  • void set_volume(value: float)

  • float get_volume()

Output volume for this channel.


Method Descriptions

bool is_voip_allowed() static 🔗

Returns true when voice chat is allowed on the current platform/account.


void set_player_muted(player: GKPlayer, muted: bool) 🔗

Mutes or unmutes player in this channel.


void start() 🔗

Starts voice chat transmission.


void stop() 🔗

Stops voice chat transmission.