|XP is just a number|
Playing soundsby Chuma (Beadle)
|on Nov 09, 2017 at 16:37 UTC||Need Help??|
Chuma has asked for the
wisdom of the Perl Monks concerning the following question:
I'm making a little game using Tk, and now I'm trying to add music to it. It's surprisingly difficult.
I would like to be able to start, stop, and change tracks at any point in the program. Ideally also play two sounds at the same time (music and sound effects), but let's take it one step at a time.
I've tried using a somewhat complicated set of forks, which exec() a system tool for playing sounds (afplay, on the Mac). But that's quite clumsy, system-dependent, and doesn't stop playing when the main program quits, which would be pretty annoying.
I've also tried using Audio::Play::MPG123, which sounded promising, but the very first line
Now I'm starting to consider calling an external Applescript, which is basically the highest level of desperation. Any other ideas?