MusicStream

class MusicStream(raw: ERROR CLASS: Symbol not found for CPointer<ERROR CLASS: Symbol not found for Music>) : Playable

Represents a music stream in raylib, which is a processed audio data structure that can be played, paused, or stopped. A music stream is typically loaded from a file and should be unloaded when it is no longer needed.

Constructors

Link copied to clipboard
constructor(raw: ERROR CLASS: Symbol not found for CPointer<ERROR CLASS: Symbol not found for Music>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The total length of the music stream in seconds, which is a positive float value.

Link copied to clipboard
open override val playing: Boolean

Whether the audio is currently playing.

Link copied to clipboard

The current time played of the music stream in seconds, which is a positive float value between 0.0 and the total length of the music stream.

Link copied to clipboard
open override val valid: Boolean

Whether the audio is valid and can be played.

Functions

Link copied to clipboard
open override fun pause(): ERROR CLASS: Unresolved name: PauseMusicStream

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
open override fun play(): ERROR CLASS: Unresolved name: PlayMusicStream

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

Link copied to clipboard
open override fun resume(): ERROR CLASS: Unresolved name: ResumeMusicStream

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
fun seek(position: Float): ERROR CLASS: Unresolved name: SeekMusicStream

Seeks the music stream to a specific position, which can be set to any positive float value between 0.0 and the total length of the music stream, in seconds. After calling this function, the music stream will be positioned at the specified time and can be played from that point with play.

Link copied to clipboard
open override fun setPan(pan: Float): ERROR CLASS: Unresolved name: SetMusicPan

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
open override fun setPitch(pitch: Float): ERROR CLASS: Unresolved name: SetMusicPitch

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
open override fun setVolume(volume: Float): ERROR CLASS: Unresolved name: SetMusicVolume

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

Link copied to clipboard
open override fun stop(): ERROR CLASS: Unresolved name: StopMusicStream

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.

Link copied to clipboard
fun unload(): ERROR CLASS: Unresolved name: UnloadMusicStream

Unloads the music stream from memory. This should be called when the music stream is no longer needed to free up resources.