godot-voip is a Godot Engine addon which makes it very easy to setup a real-time voice-chat system in your Godot game. This addon also includes a demo project.
godot-voip is a Godot Engine addon which makes it very easy to setup a real-time voice-chat system in your Godot game. This addon also includes a demo project.
⚠ currently unmaintained ⚠
(Any kind of high-level multiplayer peer is required.)
addons/godot-voip/
folder and move it into your Godot project.
(Note: make sure the structure is still res://addons/godot-voip/
)VoiceInstance
(one connection) or a VoiceOrchestrator
(more than 2 participants) node to your scene.$VoiceInstance.recording
or $VoiceOrchestrator.recording
to true
and it will send your microphone input to connected participants.Users running godot-voip on macOS need to make sure the microphone format in macOS audio settings is equal to the mix-rate in Godot project-settings.
Some parts of this library have been ported to gdnative-rust to improve performance and to implement compression using the opus-codec and other audio processing. To use the gdnative implementation use the NativeVoiceInstance
node instead of the usual VoiceIntance
.
To compile the gdnative parts of this library you will need Rust installed on your machine: https://www.rust-lang.org/. Then open addons/gdnative/
in your terminal and run cargo build
. You'll find the compiled binary in target/
. Then add the compiled binary to your platform in the godot-voip gdnative library called godot-voip-native.tres
also found in the gdnative directory.
This node implements a single voice connection.
received_voice_data(data: PoolRealArray, from_id: int)
Emitted when voice data is received.sent_voice_data(data: PoolRealArray)
Emitted when recording and data is sent.Type | Name | description |
---|---|---|
NodePath |
custom_voice_audio_stream_player | When used, the referenced AudioStreamPlayer /AudioStreamPlayer2D /AudioStreamPlayer3D will be used as output for incoming audio data. |
bool |
recording | If true, the VoiceInstance will process and send microhphone audio to the other VoipInstance. |
bool |
listen | If true, the VoiceInstance will also play any microhphone data it records. |
float |
input_threshold | Value above which microhphone data will be sent. Set to 0 to disable. |
This node implements a single voice connection using rust-gdnative.
received_voice_data(data: PoolRealArray, sender_id: int)
Emitted when voice data is received.sent_voice_data(data: PoolRealArray)
Emitted when recording and data is sent.Type | Name | description |
---|---|---|
NodePath |
custom_voice_audio_stream_player | When used, the referenced AudioStreamPlayer /AudioStreamPlayer2D /AudioStreamPlayer3D will be used as output for incoming audio data. |
bool |
recording | If true, the NativeVoiceInstance will process and send microhphone audio to the other NativeVoiceInstance. |
bool |
listen | If true, the NativeVoiceInstance will also play any microhphone data it records. |
float |
input_threshold | Value above which microhphone data will be sent. Set to 0 to disable. |
This node implements multiple voice connections. It will automatically spawn new VoiceInstances when a player connects to the server and will remove them again after they disconnect.
received_voice_data(data: PoolRealArray, from_id: int)
Emitted when voice data is received.sent_voice_data(data: PoolRealArray)
Emitted when recording and data is sent.created_instance(id: int)
Emitted when a new VoiceInstance
is created.removed_instance(id: int)
Emitted when a VoiceInstance
is removed.Type | Name | description |
---|---|---|
bool |
recording | If true, the VoiceInstance will process and send microhphone data to the other VoipInstance. |
bool |
listen | If true, the VoiceInstance will also play any microhphone data it records. |
float |
input_threshold | Value above which microhphone data will be sent. Set to 0 to disable. |
enum |
type_voice_instance | Type of VoiceInstance used. NATIVE, GDSCRIPT |
VoiceOrchestrator does not support a custom AudioStreamPlayer
.