0 votes

Hello,

I'm trying to make audio recordings using busses and AudioStreamPlayer.
I tried to do the tutorial: https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record

I tried on Linux and on Android it doesn't work, I think I set something wrong.

Did anyone manage to make any recordings with this tutorial?`

extends Control

var effect
var recording

func _ready():

# We get the index of the "Record" bus.
var idx = AudioServer.get_bus_index("Record")
# And use it to retrieve its first effect, which has been defined
# as an "AudioEffectRecord" resource.
effect = AudioServer.get_bus_effect(idx, 0)

func onListen_pressed():

find_node("ListenAudio").play()

func onRecord_pressed():

if effect.is_recording_active():
    endRecording()
    print("end recording")

else:
    effect.set_recording_active(true)
    print("recording")
    find_node("Timer").start()

func onListenRecord_pressed():

find_node("ListenRecordAudio").play()

func onTimer_timeout():

endRecording()
find_node("Timer").stop()
print("end recording timer")

func endRecording():

find_node("ListenRecord").modulate.a = 1
effect.set_recording_active(false)
recording = effect.get_recording()
print(recording)
print(recording.format)
print(recording.mix_rate)
print(recording.stereo)
var data = recording.get_data()
for i in range(0, data.size()):
    print(data[i])
print(data)
print(data.size())
find_node("ListenRecordAudio").stream = recording

`

Thank's all

asked Apr 18 in Engine by Saxe (18 points)

1 Answer

0 votes

There are known issues with audio recording on Linux, see #33184.

answered Apr 22 by Calinou (5,674 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.