Skip to main content
reskate.music reads the song playing and skips it. Every function, and the track_changed event, needs the music permission; calling one without it raises an error. See permissions. There are two kinds of music:
  • An outside player: Spotify or another app playing on the player’s computer, read and controlled through Windows’ own media controls (the ones the media keys use). current, play, pause, next and previous work on it.
  • The game’s own soundtrack, on the player’s headphones. game and game_next work on it. While a Spotify station is on, the outside player’s song is the one heard, and the game’s soundtrack has no song.
play, pause, next, previous and game_next share a budget of 2 calls a second.

An outside player

reskate.music.current()

The song the outside player has now. The first call starts ReSkate listening to it.
table or nil
nil when there is no outside player to read.
Needs the music permission.

reskate.music.play()

Tells the outside player to play.
boolean
True when the command was sent. It does not say an app took it.
string
"more than 2 a second" when ok is false.
Needs the music permission.

reskate.music.pause()

Tells the outside player to pause.
boolean
True when the command was sent.
string
"more than 2 a second" when ok is false.
Needs the music permission.

reskate.music.next()

Tells the outside player to skip to the next song.
boolean
True when the command was sent.
string
"more than 2 a second" when ok is false.
Needs the music permission (and input for the example’s bind).

reskate.music.previous()

Tells the outside player to go back a song.
boolean
True when the command was sent.
string
"more than 2 a second" when ok is false.
Needs the music permission.

The game’s soundtrack

reskate.music.game()

The song the game’s own soundtrack plays now.
table or nil
nil while a Spotify station is on, or before a song has started.
Needs the music permission.

reskate.music.game_next()

Skips the game’s soundtrack to its next song.
boolean
True when the song was skipped.
string
Why not: "asked more than twice in a second" or "the game's music cannot skip now (a Spotify station is on, or no song has started)".
Needs the music permission. Shares the budget of 2 calls a second with the outside player’s commands.

The track_changed event

Fired when anything about the outside player’s song changes: another song, or it pauses or plays. ReSkate looks once a second. The game’s own soundtrack does not fire it.
string
The app playing it, by its application id as Windows names it.
string
The song’s title.
string
Its artist.
boolean
False while it is paused.
The event’s table has no album; call reskate.music.current() for it. Registering a handler needs the music permission. See events.