Playable

interface Playable

Represents a playable audio format in raylib.

Inheritors

Properties

Link copied to clipboard
abstract val playing: Boolean

Whether the audio is currently playing.

Link copied to clipboard
abstract val valid: Boolean

Whether the audio is valid and can be played.

Functions

Link copied to clipboard
abstract fun pause()

Pauses the audio. If the audio is not playing, this function does nothing. After calling this function, the audio will be paused at its current position and can be resumed with resume.

Link copied to clipboard
abstract fun play()

Plays the audio. If the audio is already playing, it will be restarted from the beginning.

Link copied to clipboard
abstract fun resume()

Resumes the audio. If the audio is not paused, this function does nothing. After calling this function, the audio will continue playing from its current position.

Link copied to clipboard
abstract fun setPan(pan: Float)

Sets the pan of the audio, which can be set between 0.0 and 1.0. A pan of 0.0 means the audio is fully left, 1.0 means the audio is fully right, and 0.5 means the audio is centered (default).

Link copied to clipboard
abstract fun setPitch(pitch: Float)

Sets the pitch of the audio, which can be set between 0.5 and 2.0. A pitch of 1.0 means normal speed, less than 1.0 means slower, and greater than 1.0 means faster.

Link copied to clipboard
abstract fun setVolume(volume: Float)

Sets the volume of the audio, which can be set between 0.0 and 1.0.

Link copied to clipboard
abstract fun stop()

Stops the audio. If the audio is not playing, this function does nothing. After calling this function, the audio will be reset to the beginning and can be played again with play.