It looks like you're new here. If you want to get involved, click one of these buttons!
The event handler works, but I only get orxSOUND_EVENT_PACKET events for my musics, and no other events. There is only a orxSOUND_EVENT_PACKET in _pstEvent->eID. When the music ends, there is no orxSOUND_EVENT_STOP.
Sorry for the late reply.
So you can indeed rely on the stop event... if you're using an object, which I recommend.
in config you'd have: and in code:
Of course that object can then be manipulated like any other objects, including pause, disable, lifetime and even time stretching (which will affect the pitch of the sounds/musics played on it).
Thanks for the info!
OK, I'll check out how to use a music object.
Suppose I have multiple music tracks in the music object's SoundList. Such as:
How can I play a specific sound from these ? (This wasn't described in the tutorial... I'm playing the sounds now directly with orxSound_Play(). Not sure how to do it with a music object.)
You can use orxObject_AddSound/orxObject_RemoveSound to add/remove sounds and music on an object. (You can also use play/pause if needed.)
Or you could simply delete that object and create a new one.
This has the advantage that it's easy to create/delete not only from code but also from config using tracks/commands.
If it works with the STOP event, that's probably the best way to do it. Thanks!
Most of the time, users only need to interface with the orxObject API without needing to dive into the various components that can be bound to an object. That includes sound/music but also spawners (useful for FXs), shaders, etc...