Page 1 of 1

Is there a way to see which Music ID is playing?

Posted: Tue Feb 17, 2026 8:09 am
by Bugala
I was looking at Hollywood's Music Commands, as well as GetAttribute options, but didn't catch any way to get info about which Music ID is playing currently.

You can query if a certain music ID is playing, but you can't find out directly which music ID is playing right now.

Is this so, or did I just not find it?

Re: Is there a way to see which Music ID is playing?

Posted: Tue Feb 17, 2026 11:24 am
by jPV
There probably isn't a direct command for it, but you can do a small function yourself:

Code: Select all

Function p_WhichMusicIsPlaying()
	; Returns the ID of a music object that is playing currently.
	; If no music is playing, then it returns Nil.
	Local t, c = GetObjects(#MUSIC)
	For Local i = 0 To c - 1
		If IsMusicPlaying(t[i]) Then Return(t[i])
	Next
EndFunction

Re: Is there a way to see which Music ID is playing?

Posted: Tue Feb 17, 2026 11:50 am
by Bugala
Thanks from this.

I actually am already keeping track myself what music is playing, but there is always a chance some bug affects this track keeping, since its main purpose is that I can simply use PlayMusic(name) without worrying if it is already playing or not. As in, it will check if that music is already playing, then it skips the PlayMusic command.

Hence I was preferring some Hollywoods own direct system to avoid bug preventing it working correctly, as in this case I am looking for thing to happen based upon what millisecond of music is played.

Right now your solution seems like the best option, since while not directly getting what music is playing, at least bugs in my own track keeping wouldnt affect it, but your system would be working independently from it, and basically doing it through hollywoods own methods.