123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- :github_url: hide
- .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the AudioEffectCapture.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_AudioEffectCapture:
- AudioEffectCapture
- ==================
- **Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
- Captures audio from an audio bus in real-time.
- Description
- -----------
- 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 :ref:`get_buffer<class_AudioEffectCapture_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.
- Properties
- ----------
- +---------------------------+-----------------------------------------------------------------------+---------+
- | :ref:`float<class_float>` | :ref:`buffer_length<class_AudioEffectCapture_property_buffer_length>` | ``0.1`` |
- +---------------------------+-----------------------------------------------------------------------+---------+
- Methods
- -------
- +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`can_get_buffer<class_AudioEffectCapture_method_can_get_buffer>` **(** :ref:`int<class_int>` frames **)** |const| |
- +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clear_buffer<class_AudioEffectCapture_method_clear_buffer>` **(** **)** |
- +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`get_buffer<class_AudioEffectCapture_method_get_buffer>` **(** :ref:`int<class_int>` frames **)** |
- +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_buffer_length_frames<class_AudioEffectCapture_method_get_buffer_length_frames>` **(** **)** |const| |
- +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_discarded_frames<class_AudioEffectCapture_method_get_discarded_frames>` **(** **)** |const| |
- +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_frames_available<class_AudioEffectCapture_method_get_frames_available>` **(** **)** |const| |
- +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_pushed_frames<class_AudioEffectCapture_method_get_pushed_frames>` **(** **)** |const| |
- +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
- Property Descriptions
- ---------------------
- .. _class_AudioEffectCapture_property_buffer_length:
- - :ref:`float<class_float>` **buffer_length**
- +-----------+--------------------------+
- | *Default* | ``0.1`` |
- +-----------+--------------------------+
- | *Setter* | set_buffer_length(value) |
- +-----------+--------------------------+
- | *Getter* | get_buffer_length() |
- +-----------+--------------------------+
- Length of the internal ring buffer, in seconds. Setting the buffer length will have no effect if already initialized.
- Method Descriptions
- -------------------
- .. _class_AudioEffectCapture_method_can_get_buffer:
- - :ref:`bool<class_bool>` **can_get_buffer** **(** :ref:`int<class_int>` frames **)** |const|
- Returns ``true`` if at least ``frames`` audio frames are available to read in the internal ring buffer.
- ----
- .. _class_AudioEffectCapture_method_clear_buffer:
- - void **clear_buffer** **(** **)**
- Clears the internal ring buffer.
- ----
- .. _class_AudioEffectCapture_method_get_buffer:
- - :ref:`PoolVector2Array<class_PoolVector2Array>` **get_buffer** **(** :ref:`int<class_int>` frames **)**
- Gets the next ``frames`` audio samples from the internal ring buffer.
- Returns a :ref:`PoolVector2Array<class_PoolVector2Array>` containing exactly ``frames`` audio samples if available, or an empty :ref:`PoolVector2Array<class_PoolVector2Array>` if insufficient data was available.
- ----
- .. _class_AudioEffectCapture_method_get_buffer_length_frames:
- - :ref:`int<class_int>` **get_buffer_length_frames** **(** **)** |const|
- Returns the total size of the internal ring buffer in frames.
- ----
- .. _class_AudioEffectCapture_method_get_discarded_frames:
- - :ref:`int<class_int>` **get_discarded_frames** **(** **)** |const|
- Returns the number of audio frames discarded from the audio bus due to full buffer.
- ----
- .. _class_AudioEffectCapture_method_get_frames_available:
- - :ref:`int<class_int>` **get_frames_available** **(** **)** |const|
- Returns the number of frames available to read using :ref:`get_buffer<class_AudioEffectCapture_method_get_buffer>`.
- ----
- .. _class_AudioEffectCapture_method_get_pushed_frames:
- - :ref:`int<class_int>` **get_pushed_frames** **(** **)** |const|
- Returns the number of audio frames inserted from the audio bus.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|