2017-09-13 04:42:36 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2020-02-01 09:03:48 +08:00
<class name= "AudioServer" inherits= "Object" version= "4.0" >
2017-09-13 04:42:36 +08:00
<brief_description >
2019-06-22 07:04:47 +08:00
Server interface for low-level audio access.
2017-09-13 04:42:36 +08:00
</brief_description>
<description >
2020-01-23 18:14:14 +08:00
[AudioServer] is a low-level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface.
2017-09-13 04:42:36 +08:00
</description>
<tutorials >
2018-11-05 15:46:27 +08:00
<link > https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link>
2017-09-13 04:42:36 +08:00
</tutorials>
<methods >
<method name= "add_bus" >
<return type= "void" >
</return>
2017-09-10 21:37:49 +08:00
<argument index= "0" name= "at_position" type= "int" default= "-1" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2017-10-10 22:00:10 +08:00
Adds a bus at [code]at_position[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "add_bus_effect" >
<return type= "void" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "effect" type= "AudioEffect" >
</argument>
2017-09-10 21:37:49 +08:00
<argument index= "2" name= "at_position" type= "int" default= "-1" >
2017-09-13 04:42:36 +08:00
</argument>
<description >
2017-10-10 22:00:10 +08:00
Adds an [AudioEffect] effect to the bus [code]bus_idx[/code] at [code]at_position[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
2020-01-20 20:11:47 +08:00
<method name= "capture_get_device" >
<return type= "String" >
2018-08-21 06:35:30 +08:00
</return>
<description >
2020-01-20 20:11:47 +08:00
Name of the current device for audio input (see [method capture_get_device_list]).
2018-08-21 06:35:30 +08:00
</description>
</method>
2020-01-20 20:11:47 +08:00
<method name= "capture_get_device_list" >
<return type= "Array" >
2019-07-10 01:11:11 +08:00
</return>
<description >
2020-01-20 20:11:47 +08:00
Returns the names of all audio input devices detected on the system.
2019-07-10 01:11:11 +08:00
</description>
</method>
2020-01-20 20:11:47 +08:00
<method name= "capture_set_device" >
<return type= "void" >
2019-07-10 01:11:11 +08:00
</return>
2020-01-20 20:11:47 +08:00
<argument index= "0" name= "name" type= "String" >
</argument>
2019-07-10 01:11:11 +08:00
<description >
2020-01-23 18:14:14 +08:00
Sets which audio input device is used for audio capture.
2019-07-10 01:11:11 +08:00
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "generate_bus_layout" qualifiers= "const" >
<return type= "AudioBusLayout" >
</return>
<description >
2019-02-13 16:23:29 +08:00
Generates an [AudioBusLayout] using the available buses and effects.
2017-09-13 04:42:36 +08:00
</description>
</method>
2018-12-08 00:38:40 +08:00
<method name= "get_bus_channels" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<description >
Returns the amount of channels of the bus at index [code]bus_idx[/code].
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "get_bus_effect" >
<return type= "AudioEffect" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "effect_idx" type= "int" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Returns the [AudioEffect] at position [code]effect_idx[/code] in bus [code]bus_idx[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_bus_effect_count" >
<return type= "int" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Returns the number of effects on the bus at [code]bus_idx[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
2019-04-15 20:49:41 +08:00
<method name= "get_bus_effect_instance" >
<return type= "AudioEffectInstance" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "effect_idx" type= "int" >
</argument>
<argument index= "2" name= "channel" type= "int" default= "0" >
</argument>
<description >
2020-01-23 18:14:14 +08:00
Returns the [AudioEffectInstance] assigned to the given bus and effect indices (and optionally channel).
2019-04-15 20:49:41 +08:00
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "get_bus_index" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "bus_name" type= "String" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Returns the index of the bus with the name [code]bus_name[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_bus_name" qualifiers= "const" >
<return type= "String" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Returns the name of the bus with the index [code]bus_idx[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_bus_peak_volume_left_db" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "channel" type= "int" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Returns the peak volume of the left speaker at bus index [code]bus_idx[/code] and channel index [code]channel[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_bus_peak_volume_right_db" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "channel" type= "int" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Returns the peak volume of the right speaker at bus index [code]bus_idx[/code] and channel index [code]channel[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_bus_send" qualifiers= "const" >
<return type= "String" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Returns the name of the bus that the bus at index [code]bus_idx[/code] sends to.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "get_bus_volume_db" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Returns the volume of the bus at index [code]bus_idx[/code] in dB.
2017-09-13 04:42:36 +08:00
</description>
</method>
2018-04-10 16:12:42 +08:00
<method name= "get_device_list" >
<return type= "Array" >
</return>
<description >
2020-01-20 20:11:47 +08:00
Returns the names of all audio devices detected on the system.
2019-06-03 07:01:42 +08:00
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "get_mix_rate" qualifiers= "const" >
<return type= "float" >
</return>
<description >
2019-07-02 18:04:26 +08:00
Returns the sample rate at the output of the [AudioServer].
2017-09-13 04:42:36 +08:00
</description>
</method>
2019-04-28 01:11:39 +08:00
<method name= "get_output_latency" qualifiers= "const" >
<return type= "float" >
</return>
<description >
2019-07-02 18:04:26 +08:00
Returns the audio driver's output latency.
2019-04-28 01:11:39 +08:00
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "get_speaker_mode" qualifiers= "const" >
<return type= "int" enum= "AudioServer.SpeakerMode" >
</return>
<description >
2017-10-10 22:00:10 +08:00
Returns the speaker configuration.
2017-09-13 04:42:36 +08:00
</description>
</method>
2019-04-28 01:11:39 +08:00
<method name= "get_time_since_last_mix" qualifiers= "const" >
<return type= "float" >
</return>
<description >
2020-01-23 18:14:14 +08:00
Returns the relative time since the last mix occurred.
2019-04-28 01:11:39 +08:00
</description>
</method>
<method name= "get_time_to_next_mix" qualifiers= "const" >
<return type= "float" >
</return>
<description >
2020-01-23 18:14:14 +08:00
Returns the relative time until the next mix occurs.
2019-04-28 01:11:39 +08:00
</description>
</method>
2017-09-13 04:42:36 +08:00
<method name= "is_bus_bypassing_effects" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<description >
2018-12-20 20:46:54 +08:00
If [code]true[/code], the bus at index [code]bus_idx[/code] is bypassing effects.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "is_bus_effect_enabled" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "effect_idx" type= "int" >
</argument>
<description >
2018-12-20 20:46:54 +08:00
If [code]true[/code], the effect at index [code]effect_idx[/code] on the bus at index [code]bus_idx[/code] is enabled.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "is_bus_mute" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<description >
2018-12-20 20:46:54 +08:00
If [code]true[/code], the bus at index [code]bus_idx[/code] is muted.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "is_bus_solo" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<description >
2018-12-20 20:46:54 +08:00
If [code]true[/code], the bus at index [code]bus_idx[/code] is in solo mode.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "lock" >
<return type= "void" >
</return>
<description >
2020-01-23 18:14:14 +08:00
Locks the audio driver's main loop.
[b]Note:[/b] Remember to unlock it afterwards.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "move_bus" >
<return type= "void" >
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<argument index= "1" name= "to_index" type= "int" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Moves the bus from index [code]index[/code] to index [code]to_index[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "remove_bus" >
<return type= "void" >
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Removes the bus at index [code]index[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "remove_bus_effect" >
<return type= "void" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "effect_idx" type= "int" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Removes the effect at index [code]effect_idx[/code] from the bus at index [code]bus_idx[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "set_bus_bypass_effects" >
<return type= "void" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "enable" type= "bool" >
</argument>
<description >
2018-12-20 20:46:54 +08:00
If [code]true[/code], the bus at index [code]bus_idx[/code] is bypassing effects.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "set_bus_effect_enabled" >
<return type= "void" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "effect_idx" type= "int" >
</argument>
<argument index= "2" name= "enabled" type= "bool" >
</argument>
<description >
2018-12-20 20:46:54 +08:00
If [code]true[/code], the effect at index [code]effect_idx[/code] on the bus at index [code]bus_idx[/code] is enabled.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "set_bus_layout" >
<return type= "void" >
</return>
<argument index= "0" name= "bus_layout" type= "AudioBusLayout" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Overwrites the currently used [AudioBusLayout].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "set_bus_mute" >
<return type= "void" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "enable" type= "bool" >
</argument>
<description >
2018-12-20 20:46:54 +08:00
If [code]true[/code], the bus at index [code]bus_idx[/code] is muted.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "set_bus_name" >
<return type= "void" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "name" type= "String" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Sets the name of the bus at index [code]bus_idx[/code] to [code]name[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "set_bus_send" >
<return type= "void" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "send" type= "String" >
</argument>
<description >
2017-11-18 08:29:32 +08:00
Connects the output of the bus at [code]bus_idx[/code] to the bus named [code]send[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "set_bus_solo" >
<return type= "void" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "enable" type= "bool" >
</argument>
<description >
2018-12-20 20:46:54 +08:00
If [code]true[/code], the bus at index [code]bus_idx[/code] is in solo mode.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "set_bus_volume_db" >
<return type= "void" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "volume_db" type= "float" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Sets the volume of the bus at index [code]bus_idx[/code] to [code]volume_db[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "swap_bus_effects" >
<return type= "void" >
</return>
<argument index= "0" name= "bus_idx" type= "int" >
</argument>
<argument index= "1" name= "effect_idx" type= "int" >
</argument>
<argument index= "2" name= "by_effect_idx" type= "int" >
</argument>
<description >
2017-10-10 22:00:10 +08:00
Swaps the position of two effects in bus [code]bus_idx[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "unlock" >
<return type= "void" >
</return>
<description >
2019-06-22 07:04:47 +08:00
Unlocks the audio driver's main loop. (After locking it, you should always unlock it.)
2017-09-13 04:42:36 +08:00
</description>
</method>
</methods>
2019-06-03 07:01:42 +08:00
<members >
2019-07-02 18:04:26 +08:00
<member name= "bus_count" type= "int" setter= "set_bus_count" getter= "get_bus_count" default= "1" >
Number of available audio buses.
2019-06-03 07:01:42 +08:00
</member>
2019-07-02 18:04:26 +08:00
<member name= "device" type= "String" setter= "set_device" getter= "get_device" default= ""Default"" >
2019-07-10 01:11:11 +08:00
Name of the current device for audio output (see [method get_device_list]).
</member>
2019-07-02 18:04:26 +08:00
<member name= "global_rate_scale" type= "float" setter= "set_global_rate_scale" getter= "get_global_rate_scale" default= "1.0" >
2019-06-03 07:01:42 +08:00
Scales the rate at which audio is played (i.e. setting it to [code]0.5[/code] will make the audio be played twice as fast).
</member>
</members>
2017-09-13 04:42:36 +08:00
<signals >
<signal name= "bus_layout_changed" >
<description >
2017-10-10 22:00:10 +08:00
Emitted when the [AudioBusLayout] changes.
2017-09-13 04:42:36 +08:00
</description>
</signal>
</signals>
<constants >
2017-11-25 06:16:30 +08:00
<constant name= "SPEAKER_MODE_STEREO" value= "0" enum= "SpeakerMode" >
2019-07-02 18:04:26 +08:00
Two or fewer speakers were detected.
2017-09-16 07:46:14 +08:00
</constant>
2018-10-25 21:14:36 +08:00
<constant name= "SPEAKER_SURROUND_31" value= "1" enum= "SpeakerMode" >
2019-07-02 18:04:26 +08:00
A 3.1 channel surround setup was detected.
2018-10-25 21:14:36 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "SPEAKER_SURROUND_51" value= "2" enum= "SpeakerMode" >
2020-01-23 18:14:14 +08:00
A 5.1 channel surround setup was detected.
2017-09-16 07:46:14 +08:00
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "SPEAKER_SURROUND_71" value= "3" enum= "SpeakerMode" >
2020-01-23 18:14:14 +08:00
A 7.1 channel surround setup was detected.
2017-09-16 07:46:14 +08:00
</constant>
2017-09-13 04:42:36 +08:00
</constants>
</class>