Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2006
    Posts
    2

    Play wav file on exit

    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.

  2. #2
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Use an invisible WMP plugin - put an Application.Exit() on the 'On Finish' event.

    Load the wav file at runtime. On your exit button -

    MediaPlayer.Play("Plugin1");

    One of many ways to do it, HTH.

  3. #3
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Ron, this seems like deja vu.

    A solution I suggested in another thread was to load and play the song and set a variable (bExit) to true. Then in the On Audio for the page on the Finish state for the audio if bExit is true then exit the application.

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  4. #4
    Join Date
    Dec 2005
    Location
    Southern California
    Posts
    73
    would using Application.Sleep(songs length) work? or would that pause the wav file?

  5. #5
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Quote Originally Posted by Gabis
    would using Application.Sleep(songs length) work? or would that pause the wav file?
    Actually, that does work who would've thought?
    Good one Gabis! Sometimes the solutions can be really simple.

  6. #6
    Join Date
    Jan 2006
    Posts
    2
    Thanks Gabis, and the rest of you for your help. The Application.Sleep command worked perfectly. I had a few other problems the first time I made this, and I'm sure I'll be back for more help

    Thanks Again

  7. #7
    Join Date
    Feb 2001
    Location
    Washington State
    Posts
    120
    I've tried the "sleep" method before, but I think the On Audio - On Finish gives you more control, as Tigger suggests. You would want to trim any silence from the end of the audio file. PJ
    Last edited by pjborg; 02-01-2006 at 12:38 AM.

Similar Threads

  1. Audio Tracks Project
    By Michael in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 03-18-2004, 10:58 PM
  2. FAQ: AutoPlay Menu Studio 3.0 Frequently Asked Questions
    By Support in forum AutoPlay Menu Studio 3.0
    Replies: 0
    Last Post: 10-10-2002, 01:15 PM
  3. Initial Wav File - Best Practice ...
    By photoworks in forum AutoPlay Menu Studio 3.0
    Replies: 2
    Last Post: 04-02-2001, 03:42 PM
  4. Can search allow manual browse even if file is found?
    By RichardShaw in forum Setup Factory 5.0
    Replies: 2
    Last Post: 08-28-2000, 06:08 PM
  5. Replies: 0
    Last Post: 08-17-2000, 02:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts