Server interface for low-level audio access.
[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.
$DOCS_URL/tutorials/audio/audio_buses.html https://godotengine.org/asset-library/asset/2758 https://godotengine.org/asset-library/asset/2760 https://godotengine.org/asset-library/asset/2762
Adds a bus at [param at_position].
Adds an [AudioEffect] effect to the bus [param bus_idx] at [param at_position].
Generates an [AudioBusLayout] using the available buses and effects.
Returns the number of channels of the bus at index [param bus_idx].
Returns the [AudioEffect] at position [param effect_idx] in bus [param bus_idx].
Returns the number of effects on the bus at [param bus_idx].
Returns the [AudioEffectInstance] assigned to the given bus and effect indices (and optionally channel).
Returns the index of the bus with the name [param bus_name]. Returns [code]-1[/code] if no bus with the specified name exist.
Returns the name of the bus with the index [param bus_idx].
Returns the peak volume of the left speaker at bus index [param bus_idx] and channel index [param channel].
Returns the peak volume of the right speaker at bus index [param bus_idx] and channel index [param channel].
Returns the name of the bus that the bus at index [param bus_idx] sends to.
Returns the volume of the bus at index [param bus_idx] in dB.
Returns the name of the current audio driver. The default usually depends on the operating system, but may be overridden via the [code]--audio-driver[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. [code]--headless[/code] also automatically sets the audio driver to [code]Dummy[/code]. See also [member ProjectSettings.audio/driver/driver].
Returns the names of all audio input devices detected on the system. [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.
Returns the sample rate at the input of the [AudioServer].
Returns the sample rate at the output of the [AudioServer].
Returns the names of all audio output devices detected on the system.
Returns the audio driver's effective output latency. This is based on [member ProjectSettings.audio/driver/output_latency], but the exact returned value will differ depending on the operating system and audio driver. [b]Note:[/b] This can be expensive; it is not recommended to call [method get_output_latency] every frame.
Returns the speaker configuration.
Returns the relative time since the last mix occurred.
Returns the relative time until the next mix occurs.
If [code]true[/code], the bus at index [param bus_idx] is bypassing effects.
If [code]true[/code], the effect at index [param effect_idx] on the bus at index [param bus_idx] is enabled.
If [code]true[/code], the bus at index [param bus_idx] is muted.
If [code]true[/code], the bus at index [param bus_idx] is in solo mode.
If [code]true[/code], the stream is registered as a sample. The engine will not have to register it before playing the sample. If [code]false[/code], the stream will have to be registered before playing it. To prevent lag spikes, register the stream as sample with [method register_stream_as_sample].
Locks the audio driver's main loop. [b]Note:[/b] Remember to unlock it afterwards.
Moves the bus from index [param index] to index [param to_index].
Forces the registration of a stream as a sample. [b]Note:[/b] Lag spikes may occur when calling this method, especially on single-threaded builds. It is suggested to call this method while loading assets, where the lag spike could be masked, instead of registering the sample right before it needs to be played.
Removes the bus at index [param index].
Removes the effect at index [param effect_idx] from the bus at index [param bus_idx].
If [code]true[/code], the bus at index [param bus_idx] is bypassing effects.
If [code]true[/code], the effect at index [param effect_idx] on the bus at index [param bus_idx] is enabled.
Overwrites the currently used [AudioBusLayout].
If [code]true[/code], the bus at index [param bus_idx] is muted.
Sets the name of the bus at index [param bus_idx] to [param name].
Connects the output of the bus at [param bus_idx] to the bus named [param send].
If [code]true[/code], the bus at index [param bus_idx] is in solo mode.
Sets the volume of the bus at index [param bus_idx] to [param volume_db].
If set to [code]true[/code], all instances of [AudioStreamPlayback] will call [method AudioStreamPlayback._tag_used_streams] every mix step. [b]Note:[/b] This is enabled by default in the editor, as it is used by editor plugins for the audio stream previews.
Swaps the position of two effects in bus [param bus_idx].
Unlocks the audio driver's main loop. (After locking it, you should always unlock it.)
- Number of available audio buses.
- Name of the current device for audio input (see [method get_input_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/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.
- Name of the current device for audio output (see [method get_output_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].
- Scales the rate at which audio is played (i.e. setting it to [code]0.5[/code] will make the audio be played at half its speed). See also [member Engine.time_scale] to affect the general simulation speed, which is independent from [member AudioServer.playback_speed_scale].
Emitted when an audio bus is added, deleted, or moved.
Emitted when the audio bus at [param bus_index] is renamed from [param old_name] to [param new_name].
Two or fewer speakers were detected.
A 3.1 channel surround setup was detected.
A 5.1 channel surround setup was detected.
A 7.1 channel surround setup was detected.
The playback will be considered of the type declared at [member ProjectSettings.audio/general/default_playback_type].
Force the playback to be considered as a stream.
Force the playback to be considered as a sample. This can provide lower latency and more stable playback (with less risk of audio crackling), at the cost of having less flexibility. [b]Note:[/b] Only currently supported on the web platform. [b]Note:[/b] [AudioEffect]s are not supported when playback is considered as a sample.
Represents the size of the [enum PlaybackType] enum.