Sound

class Sound(raw: ERROR CLASS: Symbol not found for CPointer<ERROR CLASS: Symbol not found for raylib.internal.Sound>) : Playable

Represents a sound in raylib, which is a processed audio data structure that can be played, paused, or stopped. A sound is typically loaded from a wave 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 raylib.internal.Sound>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val playing: Boolean

Whether the audio is currently playing.

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: PauseSound

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: PlaySound

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: ResumeSound

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
open override fun setPan(pan: Float): ERROR CLASS: Unresolved name: SetSoundPan

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: SetSoundPitch

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: SetSoundVolume

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: StopSound

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: UnloadSound

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