2021-01-28 20:47:50 +01:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-03-01 01:44:37 +01:00
<class name= "AudioEffectCapture" inherits= "AudioEffect" version= "4.1" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2021-01-28 20:47:50 +01:00
<brief_description >
Captures audio from an audio bus in real-time.
</brief_description>
<description >
AudioEffectCapture is an AudioEffect which copies all audio frames from the attached audio effect bus into its internal ring buffer.
2022-09-02 19:17:00 +02:00
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/driver/enable_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.
2021-01-28 20:47:50 +01:00
</description>
<tutorials >
2022-06-20 01:11:11 +02:00
<link title= "Audio buses" > $DOCS_URL/tutorials/audio/audio_buses.html</link>
2022-09-02 19:17:00 +02:00
<link title= "Audio Mic Record Demo" > https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record</link>
2021-01-28 20:47:50 +01:00
</tutorials>
<methods >
<method name= "can_get_buffer" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "frames" type= "int" />
2021-01-28 20:47:50 +01:00
<description >
2022-08-12 19:51:01 +02:00
Returns [code]true[/code] if at least [param frames] audio frames are available to read in the internal ring buffer.
2021-01-28 20:47:50 +01:00
</description>
</method>
<method name= "clear_buffer" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2021-01-28 20:47:50 +01:00
<description >
Clears the internal ring buffer.
</description>
</method>
<method name= "get_buffer" >
2021-07-30 15:28:05 +02:00
<return type= "PackedVector2Array" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "frames" type= "int" />
2021-01-28 20:47:50 +01:00
<description >
2022-08-12 19:51:01 +02:00
Gets the next [param frames] audio samples from the internal ring buffer.
Returns a [PackedVector2Array] containing exactly [param frames] audio samples if available, or an empty [PackedVector2Array] if insufficient data was available.
2021-01-28 20:47:50 +01:00
</description>
</method>
<method name= "get_buffer_length_frames" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2021-01-28 20:47:50 +01:00
<description >
Returns the total size of the internal ring buffer in frames.
</description>
</method>
<method name= "get_discarded_frames" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2021-01-28 20:47:50 +01:00
<description >
Returns the number of audio frames discarded from the audio bus due to full buffer.
</description>
</method>
<method name= "get_frames_available" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2021-01-28 20:47:50 +01:00
<description >
Returns the number of frames available to read using [method get_buffer].
</description>
</method>
<method name= "get_pushed_frames" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2021-01-28 20:47:50 +01:00
<description >
Returns the number of audio frames inserted from the audio bus.
</description>
</method>
</methods>
<members >
<member name= "buffer_length" type= "float" setter= "set_buffer_length" getter= "get_buffer_length" default= "0.1" >
2021-03-17 19:18:22 +01:00
Length of the internal ring buffer, in seconds. Setting the buffer length will have no effect if already initialized.
2021-01-28 20:47:50 +01:00
</member>
</members>
</class>