-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: implement livekit * clean * wip (windows) * add voicechat and android support * doc * clippy and format * fix: set correct linker on android, fail on error (#46) * chore: remove unused asset (#48) * remove unused `use` * update CI --------- Co-authored-by: Mateo Miccino <[email protected]>
- Loading branch information
1 parent
54760ca
commit 9cd4af8
Showing
29 changed files
with
1,041 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
[gd_resource type="AudioBusLayout" format=3 uid="uid://ctjmxlxnfk873"] | ||
[gd_resource type="AudioBusLayout" load_steps=2 format=3 uid="uid://ctjmxlxnfk873"] | ||
|
||
[sub_resource type="AudioEffectCapture" id="AudioEffectCapture_umb32"] | ||
resource_name = "Capture" | ||
|
||
[resource] | ||
bus/0/volume_db = 0.0672607 | ||
bus/1/name = &"Capture" | ||
bus/1/solo = false | ||
bus/1/mute = true | ||
bus/1/bypass_fx = false | ||
bus/1/volume_db = 0.0 | ||
bus/1/send = &"Master" | ||
bus/1/effect/0/effect = SubResource("AudioEffectCapture_umb32") | ||
bus/1/effect/0/enabled = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
extends Control | ||
|
||
var recording: bool = false | ||
var _effect_capture: AudioEffectCapture | ||
var _prev_frame_recording = false | ||
|
||
@onready var button_record = $Button | ||
@onready var audio_stream_player = $AudioStreamPlayer | ||
|
||
|
||
func _ready(): | ||
var devices = AudioServer.get_input_device_list() | ||
print(AudioServer.get_input_device_list()) | ||
# AudioServer.input_device = devices[1] | ||
|
||
var idx = AudioServer.get_bus_index("Capture") | ||
_effect_capture = AudioServer.get_bus_effect(idx, 0) | ||
|
||
audio_stream_player.stream = AudioStreamMicrophone.new() | ||
audio_stream_player.bus = "Capture" | ||
|
||
|
||
func _process(delta): | ||
if recording: | ||
var stereo_data: PackedVector2Array = _effect_capture.get_buffer( | ||
_effect_capture.get_frames_available() | ||
) | ||
if stereo_data.size() > 0: | ||
Global.comms.broadcast_voice(stereo_data) | ||
|
||
_prev_frame_recording = recording | ||
|
||
|
||
func _on_button_pressed(): | ||
if recording: | ||
button_record.text = "Enable mic" | ||
recording = false | ||
_effect_capture.clear_buffer() | ||
audio_stream_player.stop() | ||
else: | ||
button_record.text = "Stop mic" | ||
recording = true | ||
audio_stream_player.play() | ||
_effect_capture.clear_buffer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[gd_scene load_steps=2 format=3 uid="uid://wgrmvh6h51w3"] | ||
|
||
[ext_resource type="Script" path="res://src/ui/voice_chat.gd" id="1_qu3n3"] | ||
|
||
[node name="voice_chat" type="Control"] | ||
layout_mode = 3 | ||
anchors_preset = 0 | ||
script = ExtResource("1_qu3n3") | ||
|
||
[node name="Button" type="Button" parent="."] | ||
layout_mode = 1 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
text = "Enable Mic" | ||
|
||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] | ||
|
||
[connection signal="pressed" from="Button" to="." method="_on_button_pressed"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[target.x86_64-pc-windows-msvc] | ||
rustflags = ["-C", "target-feature=+crt-static"] | ||
|
||
[target.aarch64-pc-windows-msvc] | ||
rustflags = ["-C", "target-feature=+crt-static"] | ||
|
||
[target.x86_64-apple-darwin] | ||
rustflags = ["-C", "link-args=-ObjC"] | ||
|
||
[target.aarch64-apple-darwin] | ||
rustflags = ["-C", "link-args=-ObjC"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.