Skip to content

Music

Functions to control music playback in the Steam client. This gives games the opportunity to do things like pause the music or lower the volume when an important cut scene is shown, and then start playing again afterwards. These functions only work with soundtracks you purchased or own on Steam.

Only available in the main GodotSteam branches

Functions

getPlaybackStatus

getPlaybackStatus()

Gets the current status of the Steam Music player.

Returns: int


Read more in the official Steamworks SDK documentation

musicIsEnabled

musicIsEnabled()

Checks if Steam Music is enabled.

Returns: bool


Read more in the official Steamworks SDK documentation

musicIsPlaying

musicIsPlaying()

Checks if Steam Music is active. This does not necessarily a song is currently playing, it may be paused. For finer grain control use getPlaybackStatus.

Returns: bool


Read more in the official Steamworks SDK documentation

musicGetVolume

musicGetVolume()

Gets the current volume of the Steam Music player.

Returns: float


Read more in the official Steamworks SDK documentation

musicPause

musicPause()

Pause the Steam Music player.

Returns: void


Read more in the official Steamworks SDK documentation

musicPlay

musicPlay()

Have the Steam Music player resume playing.

Returns: void


Read more in the official Steamworks SDK documentation

musicPlayNext

musicPlayNext()

Have the Steam Music player skip to the next song.

Returns: void


Read more in the official Steamworks SDK documentation

musicPlayPrev

musicPlayPrev()

Have the Steam Music player play the previous song.

Returns: void


Read more in the official Steamworks SDK documentation

musicSetVolume

musicSetVolume( float value )

Sets the volume of the Steam Music player.

Returns: void


Read more in the official Steamworks SDK documentation

Signals

These callbacks require you to run Steam.run_callbacks() in your _process() function to receive them.

music_playback_status_has_changed

music_playback_status_has_changed

No notes about this in the Steam docs, but we can assume it just updates us about the playback status.

Returns: nothing

music_volume_has_changed

music_volume_has_changed

No notes about this in the Steam docs, but we can assume it just updates us about the volume changes.

Returns: new_volume (float)

Enums

AudioPlaybackStatus

Enumerator Value
AUDIO_PLAYBACK_UNDEFINED 0
AUDIO_PLAYBACK_PLAYING 1
AUDIO_PLAYBACK_PAUSED 2
AUDIO_PLAYBACK_IDLE 3