I'm trying to make a jukebox and for the moment this is what I have
obj/jukebox
var/list
sounds = list("def1" = 'def1.ogg', "def2" = 'def.ogg')
verb/Playsound()
set src in oview(1)
var/Sound = input("Which one?") in sounds
usr << sounds[Sound]
It works fine, but I've made two different icons for when it's off and when it's on.
And I do not know how to add them
if anyone knows how to add them, I would appreciate it
The difficult part is turning it off once the sound ends. DM doesn't provide a way to get the duration of a sound file... One thing I've done is to specify the durations of the sounds in some way, and checking them manually. Or, you could avoid the problem by having it play on loop until turned off.