From ac31fac9a53a01b0d372e182ee9270da83b42b41 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 2 Sep 2022 19:17:00 +0200 Subject: [PATCH] Improve documentation related to audio input permissions --- doc/classes/AudioEffectCapture.xml | 5 ++++- doc/classes/AudioServer.xml | 4 +++- doc/classes/AudioStreamMicrophone.xml | 4 ++++ doc/classes/ProjectSettings.xml | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/classes/AudioEffectCapture.xml b/doc/classes/AudioEffectCapture.xml index fd49e473492..574b4a4102d 100644 --- a/doc/classes/AudioEffectCapture.xml +++ b/doc/classes/AudioEffectCapture.xml @@ -5,9 +5,12 @@ AudioEffectCapture is an AudioEffect which copies all audio frames from the attached audio effect bus into its internal ring buffer. - Application code should consume these audio frames from this ring buffer using [method get_buffer] and process it as needed, for example to capture data from a microphone, implement application defined effects, or to transmit audio over the network. When capturing audio data from a microphone, the format of the samples will be stereo 32-bit floating point PCM. + Application code should consume these audio frames from this ring buffer using [method get_buffer] and process it as needed, for example to capture data from an [AudioStreamMicrophone], implement application-defined effects, or to transmit audio over the network. When capturing audio data from a microphone, the format of the samples will be stereo 32-bit floating point PCM. + [b]Note:[/b] [member ProjectSettings.audio/enable_audio_input] must be [code]true[/code] for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings. + $DOCS_URL/tutorials/audio/audio_buses.html + https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml index e86b064b539..7f3b446d82d 100644 --- a/doc/classes/AudioServer.xml +++ b/doc/classes/AudioServer.xml @@ -33,6 +33,7 @@ Returns the names of all audio input devices detected on the system. + [b]Note:[/b] [member ProjectSettings.audio/enable_audio_input] must be [code]true[/code] for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings. @@ -296,7 +297,8 @@ Number of available audio buses. - Name of the current device for audio input (see [method get_device_list]). On systems with multiple audio inputs (such as analog, USB and HDMI audio), this can be used to select the audio input device. The value [code]"Default"[/code] will record audio on the system-wide default audio input. If an invalid device name is set, the value will be reverted back to [code]"Default"[/code]. + Name of the current device for audio input (see [method capture_get_device_list]). On systems with multiple audio inputs (such as analog, USB and HDMI audio), this can be used to select the audio input device. The value [code]"Default"[/code] will record audio on the system-wide default audio input. If an invalid device name is set, the value will be reverted back to [code]"Default"[/code]. + [b]Note:[/b] [member ProjectSettings.audio/enable_audio_input] must be [code]true[/code] for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings. Name of the current device for audio output (see [method get_device_list]). On systems with multiple audio outputs (such as analog, USB and HDMI audio), this can be used to select the audio output device. The value [code]"Default"[/code] will play audio on the system-wide default audio output. If an invalid device name is set, the value will be reverted back to [code]"Default"[/code]. diff --git a/doc/classes/AudioStreamMicrophone.xml b/doc/classes/AudioStreamMicrophone.xml index 30edb0c6e01..592b2c1280b 100644 --- a/doc/classes/AudioStreamMicrophone.xml +++ b/doc/classes/AudioStreamMicrophone.xml @@ -1,10 +1,14 @@ + Plays real-time audio input data. + When used directly in an [AudioStreamPlayer] node, [AudioStreamMicrophone] plays back microphone input in real-time. This can be used in conjunction with [AudioEffectCapture] to process the data or save it. + [b]Note:[/b] [member ProjectSettings.audio/enable_audio_input] must be [code]true[/code] for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings. + https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 58a8ed30f69..a763558056d 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -282,6 +282,7 @@ If [code]true[/code], microphone input will be allowed. This requires appropriate permissions to be set when exporting to Android or iOS. + [b]Note:[/b] If the operating system blocks access to audio input devices (due to the user's privacy settings), audio capture will only return silence. On Windows 10 and later, make sure that apps are allowed to access the microphone in the OS' privacy settings. The mixing rate used for audio (in Hz). In general, it's better to not touch this and leave it to the host operating system.