Skip to content
reduz edited this page Apr 10, 2014 · 10 revisions

AudioStream

####Inherits: Resource ####Category: Core

Brief Description

Base class for audio streams.

Member Functions

Numeric Constants

  • UPDATE_NONE = 0 - Does not need update, or manual polling.
  • UPDATE_IDLE = 1 - Stream is updated on the main thread, when idle.
  • UPDATE_THREAD = 2 - Stream is updated on its own thread.

Description

Base class for audio streams. Audio streams are used for music"#10;"#9;playback, or other types of streamed sounds that don't fit or"#10;"#9;requiere more flexibility than a Sample.

Member Function Description

  • void play ( )

Start playback of an audio stream.

  • void stop ( )

Stop playback of an audio stream.

  • bool is_playing ( ) const

Return wether the audio stream is currently playing.

  • void set_loop ( bool enabled )

Set the loop hint for the audio stream playback. if"#10;"#9;"#9;"#9;true, audio stream will attempt to loop (restart)"#10;"#9;"#9;"#9;when finished.

  • bool has_loop ( ) const

Return wether the audio stream loops. See set_loop

  • String get_stream_name ( ) const

Return the name of the audio stream. Often the song"#10;"#9;"#9;"#9;title when the stream is music.

  • int get_loop_count ( ) const

Return the amount of times that the stream has"#10;"#9;"#9;"#9;looped (if loop is supported).

  • void seek_pos ( float pos )

Seek to a certain position (in seconds) in an audio"#10;"#9;"#9;"#9;stream.

  • float get_pos ( ) const

Return the current playing position (in seconds) of the audio"#10;"#9;"#9;"#9;stream (if supported). Since this value is updated"#10;"#9;"#9;"#9;internally, it may not be exact or updated"#10;"#9;"#9;"#9;continuosly. Accuracy depends on the sample buffer"#10;"#9;"#9;"#9;size of the audio driver.

  • int get_update_mode ( ) const

Return the type of update that the stream uses. Some"#10;"#9;"#9;"#9;types of stream may need manual polling.

  • void update ( )

Manually poll the audio stream (if it is requested"#10;"#9;"#9;"#9;to).

Clone this wiki locally