AudioServer
Inherits: Object Server interface for low-level audio access.
Description
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.
Tutorials
- Audio buses
- Audio Device Changer Demo
- Audio Mic Record Demo
- Audio Spectrum Demo
Properties
Methods
Signals
- bus_layout_changed ( )
AudioBusLayout changes.
Enumerations
SpeakerMode: - SPEAKER_MODE_STEREO = 0 —- Two or fewer speakers were detected.
- SPEAKER_SURROUND_31 = 1 —- A 3.1 channel surround setup was detected.
- SPEAKER_SURROUND_51 = 2 —- A 5.1 channel surround setup was detected.
- SPEAKER_SURROUND_71 = 3 —- A 7.1 channel surround setup was detected.
Property Descriptions
- int bus_count Number of available audio buses.
- String capture_device
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
"Default"will record audio on the system-wide default audio input. If an invalid device name is set, the value will be reverted back to"Default".
- String device
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
"Default"will play audio on the system-wide default audio output. If an invalid device name is set, the value will be reverted back to"Default".
- float global_rate_scale
0.5will make the audio be played twice as fast).Method Descriptions
- add_bus ( int at_position=-1 )
at_position.
- add_bus_effect ( int bus_idx, AudioEffect effect, int at_position=-1 )
AudioEffect effect to the bus
bus_idxatat_position.
- Array capture_get_device_list ( ) Returns the names of all audio input devices detected on the system.
- AudioBusLayout generate_bus_layout ( ) const AudioBusLayout using the available buses and effects.
- int get_bus_channels ( int bus_idx ) const
bus_idx.
- AudioEffect get_bus_effect ( int bus_idx, int effect_idx )
AudioEffect at position
effect_idxin busbus_idx.
- int get_bus_effect_count ( int bus_idx )
bus_idx.
- AudioEffectInstance get_bus_effect_instance ( int bus_idx, int effect_idx, int channel=0 ) AudioEffectInstance assigned to the given bus and effect indices (and optionally channel).
- int get_bus_index ( String bus_name ) const
bus_name.
- String get_bus_name ( int bus_idx ) const
bus_idx.
- float get_bus_peak_volume_left_db ( int bus_idx, int channel ) const
bus_idxand channel indexchannel.
- float get_bus_peak_volume_right_db ( int bus_idx, int channel ) const
bus_idxand channel indexchannel.
- String get_bus_send ( int bus_idx ) const
bus_idxsends to.
- float get_bus_volume_db ( int bus_idx ) const
bus_idxin dB.
- Array get_device_list ( ) Returns the names of all audio devices detected on the system.
- float get_mix_rate ( ) const
AudioServer.
- float get_output_latency ( ) const Returns the audio driver’s output latency.
- SpeakerMode get_speaker_mode ( ) const Returns the speaker configuration.
- float get_time_since_last_mix ( ) const Returns the relative time since the last mix occurred.
- float get_time_to_next_mix ( ) const Returns the relative time until the next mix occurs.
- bool is_bus_bypassing_effects ( int bus_idx ) const
true, the bus at indexbus_idxis bypassing effects.
- bool is_bus_effect_enabled ( int bus_idx, int effect_idx ) const
true, the effect at indexeffect_idxon the bus at indexbus_idxis enabled.
- bool is_bus_mute ( int bus_idx ) const
true, the bus at indexbus_idxis muted.
- bool is_bus_solo ( int bus_idx ) const
true, the bus at indexbus_idxis in solo mode.
- lock ( ) Locks the audio driver’s main loop. Note: Remember to unlock it afterwards.
- move_bus ( int index, int to_index )
indexto indexto_index.
- remove_bus ( int index )
index.
- remove_bus_effect ( int bus_idx, int effect_idx )
effect_idxfrom the bus at indexbus_idx.
- set_bus_bypass_effects ( int bus_idx, bool enable )
true, the bus at indexbus_idxis bypassing effects.
- set_bus_effect_enabled ( int bus_idx, int effect_idx, bool enabled )
true, the effect at indexeffect_idxon the bus at indexbus_idxis enabled.
- set_bus_layout ( AudioBusLayout bus_layout ) AudioBusLayout.
- set_bus_mute ( int bus_idx, bool enable )
true, the bus at indexbus_idxis muted.
- set_bus_name ( int bus_idx, String name )
bus_idxtoname.
- set_bus_send ( int bus_idx, String send )
bus_idxto the bus namedsend.
- set_bus_solo ( int bus_idx, bool enable )
true, the bus at indexbus_idxis in solo mode.
- set_bus_volume_db ( int bus_idx, float volume_db )
bus_idxtovolume_db.
- swap_bus_effects ( int bus_idx, int effect_idx, int by_effect_idx )
bus_idx.
- unlock ( ) Unlocks the audio driver’s main loop. (After locking it, you should always unlock it.)
