Can't get microphone recording working on MacOS

Godot Version

4.4.1 stable

Question

I am trying to get live microphone feed but I can’t get it working. My code looks like this:

extends Node

@onready var recorder: AudioStreamPlayer = $Recorder

var playback: AudioStreamGeneratorPlayback
var effect: AudioEffectCapture
var bus_index: int

func _ready():
	recorder.stream = AudioStreamMicrophone.new()
	recorder.play()
	
	bus_index = AudioServer.get_bus_index("Recorder")
	effect = AudioServer.get_bus_effect(bus_index, 0)
	
func _process(_delta: float) -> void:
	var frames: PackedVector2Array = effect.get_buffer(effect.get_frames_available())
	if frames.size() > 0:
		print(frames[0])

and my buses:

The code just prints out zeroes as if there was no sound and in the console it’s spamming this error:

E 0:00:01:918   input_callback: AudioUnitRender failed, code: -50
  <C++ source>   drivers/coreaudio/audio_driver_coreaudio.mm:260 @ input_callback()

ChatGPT says that this means some parameter is missconfigured but i can’t find what. I have tried restarting my computer, chaning the mix rate to 48000, godot has microphone permissions but it’s still giving me the same error.

Did you enable audio input under Project Settings -> Audio -> Driver -> Enable Input?

Could you try this demo godot-demo-projects/audio/mic_record at master · godotengine/godot-demo-projects · GitHub and see if it works?

If neither work then you should open an issue in the issue tracker and give as much information as possible.

Yep, i have enebled audio recording in project settings. It seems like the demo project you sent me is also crashes so I’m opening an issue.