I have an AMS5 project that I'm trying to update. Since i don't have the am5 file anymore, I believe I have to start from scratch.
I am trying to play a wav file before exiting the app when clicking the exit button. How do I script it so the wav file plays completely before exiting?
I've tried these on the On Click event for the exit button
Audio.Load(CHANNEL_USER1, "AutoPlay\\Audio\\TCmdD238.wav", true, false);
Application.Exit(0);
This starts the wav file, but exits before it is finished
And
Audio.Load(CHANNEL_USER1, "AutoPlay\\Audio\\TCmdD238.wav", true, false);
length = Audio.GetLength(CHANNEL_USER1);
repeat
position = Audio.GetCurrentPos(CHANNEL_USER1);
until position == length;
Application.Exit(0);
This plays the wav file, but then the application hangs and never exits.
I'd like to know what I'm doing wrong. I'm betting it's somewhere close to everything.

