Skip to content

Latest commit

 

History

History
110 lines (62 loc) · 3.67 KB

class_audiostreamplayer2d.rst

File metadata and controls

110 lines (62 loc) · 3.67 KB

AudioStreamPlayer2D

Inherits: Node2D<class_node2d> < CanvasItem<class_canvasitem> < Node<class_node> < Object<class_object>

Category: Core

Brief Description

Plays audio in 2D.

Member Functions

float<class_float> get_playback_position<class_AudioStreamPlayer2D_get_playback_position> ( )
void play<class_AudioStreamPlayer2D_play> ( float<class_float> from_position=0.0 )
void seek<class_AudioStreamPlayer2D_seek> ( float<class_float> to_position )
void stop<class_AudioStreamPlayer2D_stop> ( )

Signals

  • finished ( )

Emitted when the audio stops playing.

Member Variables

  • int<class_int> area_mask - Areas in which this sound plays.
  • float<class_float> attenuation - Dampens audio over distance with this as an exponent.
  • bool<class_bool> autoplay - If true audio plays when added to scene tree. Default value: false.
  • String<class_string> bus - Bus on which this audio is playing.
  • float<class_float> max_distance - Maximum distance from which audio is still hearable.
  • bool<class_bool> playing - If true audio is playing.
  • AudioStream<class_audiostream> stream - The AudioStream<class_audiostream> object to be played.
  • float<class_float> volume_db - Base volume without dampening.

Description

Plays audio that dampens with distance from screen center.

Member Function Description

  • float<class_float> get_playback_position ( )

Returns the position in the AudioStream<class_audiostream>.

  • void play ( float<class_float> from_position=0.0 )

Plays the audio from the given position 'from_position', in seconds.

  • void seek ( float<class_float> to_position )

Sets the position from which audio will be played, in seconds.

  • void stop ( )

Stops the audio.