The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

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

in Engine by (18 points)

2 Answers

0 votes

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

by (12,878 points)
0 votes

I tried but, got error at effect.set_recording_active(true). It says null function.
So, I downloaded the demo which, worked.
I also narrowed down the problem by comparing and eventually found only one.
When I clicked record bus, I saw the path value set to something in the resource while Mine wasn't. But copy-pasting didn't solve it.

image

by (29 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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.