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 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 device get_device_list).

  • float global_rate_scale 0.5 will 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_idx at at_position.

  • String capture_get_device ( ) capture_get_device_list).

  • Array capture_get_device_list ( ) Returns the names of all audio input devices detected on the system.

  • capture_set_device ( String name ) Sets which audio input device is used for audio capture.

  • 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_idx in bus bus_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_idx and channel index channel.

  • float get_bus_peak_volume_right_db ( int bus_idx, int channel ) const bus_idx and channel index channel.

  • String get_bus_send ( int bus_idx ) const bus_idx sends to.

  • float get_bus_volume_db ( int bus_idx ) const bus_idx in 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 index bus_idx is bypassing effects.

  • bool is_bus_effect_enabled ( int bus_idx, int effect_idx ) const true, the effect at index effect_idx on the bus at index bus_idx is enabled.

  • bool is_bus_mute ( int bus_idx ) const true, the bus at index bus_idx is muted.

  • bool is_bus_solo ( int bus_idx ) const true, the bus at index bus_idx is in solo mode.

  • lock ( ) Locks the audio driver’s main loop. Note: Remember to unlock it afterwards.

  • move_bus ( int index, int to_index ) index to index to_index.

  • remove_bus ( int index ) index.

  • remove_bus_effect ( int bus_idx, int effect_idx ) effect_idx from the bus at index bus_idx.

  • set_bus_bypass_effects ( int bus_idx, bool enable ) true, the bus at index bus_idx is bypassing effects.

  • set_bus_effect_enabled ( int bus_idx, int effect_idx, bool enabled ) true, the effect at index effect_idx on the bus at index bus_idx is enabled.

  • set_bus_layout ( AudioBusLayout bus_layout ) AudioBusLayout.

  • set_bus_mute ( int bus_idx, bool enable ) true, the bus at index bus_idx is muted.

  • set_bus_name ( int bus_idx, String name ) bus_idx to name.

  • set_bus_send ( int bus_idx, String send ) bus_idx to the bus named send.

  • set_bus_solo ( int bus_idx, bool enable ) true, the bus at index bus_idx is in solo mode.

  • set_bus_volume_db ( int bus_idx, float volume_db ) bus_idx to volume_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.)