Fix for audioManager bug

This commit is contained in:
2026-01-22 16:38:45 +01:00
parent 7a25061377
commit c80726d241
3 changed files with 8 additions and 5 deletions

4
.gitignore vendored
View File

@@ -14,4 +14,6 @@ export_credentials.cfg
# Mono-specific ignores
.mono/
data_*/
mono_crash.*.json
mono_crash.*.json
addons/godotsteam/win64/~libgodotsteam.windows.template_debug.x86_64.dll
addons/twovoip/libs/~libtwovoip.windows.template_debug.x86_64.dll

View File

@@ -107,9 +107,6 @@ mouse_filter = 2
[node name="Spectators" type="Node3D" parent="."]
[node name="MapSpawner" type="MultiplayerSpawner" parent="."]
_spawnable_scenes = PackedStringArray("uid://bco4seshb8fjf", "uid://k0jpd2sugl7b")
[node name="PlayerSpawner" type="MultiplayerSpawner" parent="."]
_spawnable_scenes = PackedStringArray("uid://rvvjguhqjtpb")
spawn_path = NodePath("../Players")

View File

@@ -34,13 +34,17 @@ func _process(_delta: float) -> void:
return
check_for_voice_local()
func add_joined_peer(id): # Fix calling this on yourself
func add_joined_peer(id):
# Does this work?
if multiplayer.get_unique_id() == id:
return
var player : Node3D = Multiplayer.playerDict.get(id)
var remote_audio_stream_playback = player.get_node_or_null(voicechat_player_path).get_stream_playback()
network_playback.set(id, remote_audio_stream_playback)
network_voice_buffer.set(id,PackedByteArray())
current_sample_rate = Steam.getVoiceOptimalSampleRate()
send_sample_rate.rpc_id(id, current_sample_rate)
func remove_disconnected_peer(id):
network_playback.erase(id)
network_voice_buffer.erase(id)