AudioServer

Inherits: Object

Category: Core

Brief Description

Server interface for low level audio access.

Member Functions

void add_bus ( int at_position=-1 )
void add_bus_effect ( int bus_idx, AudioEffect effect, int at_position=-1 )
AudioBusLayout generate_bus_layout ( ) const
int get_bus_count ( ) const
AudioEffect get_bus_effect ( int bus_idx, int effect_idx )
int get_bus_effect_count ( int bus_idx )
int get_bus_index ( String bus_name ) const
String get_bus_name ( int bus_idx ) const
float get_bus_peak_volume_left_db ( int bus_idx, int channel ) const
float get_bus_peak_volume_right_db ( int bus_idx, int channel ) const
String get_bus_send ( int bus_idx ) const
float get_bus_volume_db ( int bus_idx ) const
float get_mix_rate ( ) const
int get_speaker_mode ( ) const
bool is_bus_bypassing_effects ( int bus_idx ) const
bool is_bus_effect_enabled ( int bus_idx, int effect_idx ) const
bool is_bus_mute ( int bus_idx ) const
bool is_bus_solo ( int bus_idx ) const
void lock ( )
void move_bus ( int index, int to_index )
void remove_bus ( int index )
void remove_bus_effect ( int bus_idx, int effect_idx )
void set_bus_bypass_effects ( int bus_idx, bool enable )
void set_bus_count ( int amount )
void set_bus_effect_enabled ( int bus_idx, int effect_idx, bool enabled )
void set_bus_layout ( AudioBusLayout bus_layout )
void set_bus_mute ( int bus_idx, bool enable )
void set_bus_name ( int bus_idx, String name )
void set_bus_send ( int bus_idx, String send )
void set_bus_solo ( int bus_idx, bool enable )
void set_bus_volume_db ( int bus_idx, float volume_db )
void swap_bus_effects ( int bus_idx, int effect_idx, int by_effect_idx )
void unlock ( )

Signals

  • bus_layout_changed ( )

Emitted when the AudioBusLayout changes.

Numeric Constants

  • SPEAKER_MODE_STEREO = 0 — Two or fewer speakers are detected.
  • 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.

Member Function Description

  • void add_bus ( int at_position=-1 )

Adds a bus at at_position.

Adds an AudioEffect effect to the bus bus_idx at at_position.

Generates an AudioBusLayout using the available busses and effects.

  • int get_bus_count ( ) const

Returns the number of available busses.

Returns the AudioEffect at position effect_idx in bus bus_idx.

  • int get_bus_effect_count ( int bus_idx )

Returns the number of effects on the bus at bus_idx.

  • int get_bus_index ( String bus_name ) const

Returns the index of the bus with the name bus_name.

Returns the name of the bus with the index bus_idx.

  • float get_bus_peak_volume_left_db ( int bus_idx, int channel ) const

Returns the peak volume of the left speaker at bus index bus_idx and channel index channel.

  • float get_bus_peak_volume_right_db ( int bus_idx, int channel ) const

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.

  • float get_bus_volume_db ( int bus_idx ) const

Returns the volume of the bus at index bus_idx in dB.

  • float get_mix_rate ( ) const

Returns the sample rate at the output of the audioserver.

  • int get_speaker_mode ( ) const

Returns the speaker configuration.

  • bool is_bus_bypassing_effects ( int bus_idx ) const

If true the bus at index bus_idx is bypassing effects.

  • bool is_bus_effect_enabled ( int bus_idx, int effect_idx ) const

If true the effect at index effect_idx on the bus at index bus_idx is enabled.

  • bool is_bus_mute ( int bus_idx ) const

If true the bus at index bus_idx is muted.

  • bool is_bus_solo ( int bus_idx ) const

If true the bus at index bus_idx is in solo mode.

  • void lock ( )

Locks the audio drivers mainloop. Remember to unlock it afterwards.

  • void move_bus ( int index, int to_index )

Moves the bus from index index to index to_index.

  • void remove_bus ( int index )

Removes the bus at index index.

  • void remove_bus_effect ( int bus_idx, int effect_idx )

Removes the effect at index effect_idx from the bus at index bus_idx.

  • void set_bus_bypass_effects ( int bus_idx, bool enable )

If true the bus at index bus_idx is bypassing effects.

  • void set_bus_count ( int amount )

Adds and removes busses to make the number of busses match amount.

  • void set_bus_effect_enabled ( int bus_idx, int effect_idx, bool enabled )

If true the effect at index effect_idx on the bus at index bus_idx is enabled.

Overwrites the currently used AudioBusLayout.

  • void set_bus_mute ( int bus_idx, bool enable )

If true the bus at index bus_idx is muted.

  • void set_bus_name ( int bus_idx, String name )

Sets the name of the bus at index bus_idx to name.

  • void set_bus_send ( int bus_idx, String send )

Connects the output of the bus at bus_idx to the bus named send.

  • void set_bus_solo ( int bus_idx, bool enable )

If true the bus at index bus_idx is in solo mode.

  • void set_bus_volume_db ( int bus_idx, float volume_db )

Sets the volume of the bus at index bus_idx to volume_db.

  • void swap_bus_effects ( int bus_idx, int effect_idx, int by_effect_idx )

Swaps the position of two effects in bus bus_idx.

  • void unlock ( )

Unlocks the audiodriver’s main loop. After locking it always unlock it.