Let’s try this from a different angle:
Once webCoRE sends a command to the hub, it has no way of knowing anything about the track. It does not know the length, or whether it worked or not… and it has no clue when the track has finished playing…
What this means for us: To loop a sound, there has to be some kind of “controller”:
- The device may be able to loop natively, or…
- It could be looped via a third party app/service, or…
- your Device Handler could
*ahem*
handle it…
- or you could code it manually in webCoRE.
(IE: Learn the length of the track & program webCoRE to periodically keep sending commands… adding a bit extra delay to account for buffering etc)
Any of the first 3 are decent possibilities, but personally, I would avoid using webCoRE to spam devices.
If the first 3 fail, what I prefer is to acquire (or create) a longer sound clip.
(longer than you would ever need)
Then webCoRE can send a single command to begin playing that long track.
… and your focus will only be on the aborting aspect, as mentioned in my last post.