:article_outdated: True .. _doc_recording_with_microphone: Recording with microphone ========================= Godot supports in-game audio recording for Windows, macOS, Linux, Android and iOS. A simple demo is included in the official demo projects and will be used as support for this tutorial: ``_. You will need to enable audio input in the project settings, or you'll just get empty audio files. The structure of the demo ------------------------- The demo consists of a single scene. This scene includes two major parts: the GUI and the audio. We will focus on the audio part. In this demo, a bus named ``Record`` with the effect ``Record`` is created to handle the audio recording. An ``AudioStreamPlayer`` named ``AudioStreamRecord`` is used for recording. .. image:: img/record_bus.png .. image:: img/record_stream_player.png .. tabs:: .. code-tab:: gdscript GDScript 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) .. code-tab:: csharp private AudioEffectRecord _effect; private AudioStreamSample _recording; public override void _Ready() { // We get the index of the "Record" bus. int idx = AudioServer.GetBusIndex("Record"); // And use it to retrieve its first effect, which has been defined // as an "AudioEffectRecord" resource. _effect = (AudioEffectRecord)AudioServer.GetBusEffect(idx, 0); } The audio recording is handled by the :ref:`class_AudioEffectRecord` resource which has three methods: :ref:`get_recording() `, :ref:`is_recording_active() `, and :ref:`set_recording_active() `. .. tabs:: .. code-tab:: gdscript GDScript func _on_record_button_pressed(): if effect.is_recording_active(): recording = effect.get_recording() $PlayButton.disabled = false $SaveButton.disabled = false effect.set_recording_active(false) $RecordButton.text = "Record" $Status.text = "" else: $PlayButton.disabled = true $SaveButton.disabled = true effect.set_recording_active(true) $RecordButton.text = "Stop" $Status.text = "Recording..." .. code-tab:: csharp private void OnRecordButtonPressed() { if (_effect.IsRecordingActive()) { _recording = _effect.GetRecording(); GetNode