AudioServer¶
Inherits: Object
Category: Core
Brief Description¶
Server interface for low level audio access.
Methods¶
Enumerations¶
enum SpeakerMode:
- SPEAKER_MODE_STEREO = 0 — Two or fewer speakers are detected.
- SPEAKER_SURROUND_31 = 1
- SPEAKER_SURROUND_51 = 2 — A 5.1 channel surround setup detected.
- SPEAKER_SURROUND_71 = 3 — A 7.1 channel surround setup detected.
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¶
Method Descriptions¶
- void add_bus ( int at_position=-1 )
Adds a bus at at_position.
- void add_bus_effect ( int bus_idx, AudioEffect effect, int at_position=-1 )
Adds an AudioEffect effect to the bus bus_idx at at_position.
- String capture_get_device ( )
- Array capture_get_device_list ( )
- void capture_set_device ( String name )
- AudioBusLayout generate_bus_layout ( ) const
Generates an AudioBusLayout using the available buses and effects.
Returns the amount of channels of the bus at index bus_idx.
- int get_bus_count ( ) const
Returns the number of available buses.
- AudioEffect get_bus_effect ( int bus_idx, int effect_idx )
Returns the AudioEffect at position effect_idx in bus bus_idx.
Returns the number of effects on the bus at bus_idx.
- AudioEffectInstance get_bus_effect_instance ( int bus_idx, int effect_idx, int channel=0 )
Returns the index of the bus with the name bus_name.
Returns the name of the bus with the index bus_idx.
Returns the peak volume of the left speaker at bus index bus_idx and channel index channel.
Returns the peak volume of the right speaker at bus index bus_idx and channel index channel.
Returns the name of the bus that the bus at index bus_idx sends to.
Returns the volume of the bus at index bus_idx in dB.
- String get_device ( )
- Array get_device_list ( )
- float get_mix_rate ( ) const
Returns the sample rate at the output of the audioserver.
- SpeakerMode get_speaker_mode ( ) const
Returns the speaker configuration.
If true, the bus at index bus_idx is bypassing effects.
If true, the effect at index effect_idx on the bus at index bus_idx is enabled.
If true, the bus at index bus_idx is muted.
If true, the bus at index bus_idx is in solo mode.
- void lock ( )
Locks the audio drivers mainloop. Remember to unlock it afterwards.
Moves the bus from index index to index to_index.
- void remove_bus ( int index )
Removes the bus at index index.
Removes the effect at index effect_idx from the bus at index bus_idx.
If true, the bus at index bus_idx is bypassing effects.
- void set_bus_count ( int amount )
Adds and removes buses to make the number of buses match amount.
If true, the effect at index effect_idx on the bus at index bus_idx is enabled.
- void set_bus_layout ( AudioBusLayout bus_layout )
Overwrites the currently used AudioBusLayout.
If true, the bus at index bus_idx is muted.
Sets the name of the bus at index bus_idx to name.
Connects the output of the bus at bus_idx to the bus named send.
If true, the bus at index bus_idx is in solo mode.
Sets the volume of the bus at index bus_idx to volume_db.
- void set_device ( String device )
Swaps the position of two effects in bus bus_idx.
- void unlock ( )
Unlocks the audiodriver’s main loop. After locking it always unlock it.