PDA

View Full Version : stopping an MP3 at a certain time


yoni
06-27-2003, 02:45 PM
I'd like to have an MP3 stop playing at a specified time. I know that I will need to use a get progress variable to find the time and then set the player to stop when it gets to the right time.

However I'm a little unclear on where I would set APM to look for the progress of the MP3. I think i would put it on the same button that starts playing the MP3 and create a loop to make it keep checking but I'm not really sure how I would do this.
Any help would be super-duper appreciated.

Worm
06-27-2003, 03:42 PM
MP3 in the MP3 Objects On Progress event.

yoni
06-27-2003, 03:45 PM
crap i didn't even think about looking at the mp3 player properties. thanks

Worm
06-27-2003, 03:47 PM
Sorry, meant to say check the Progress in the MP3 Objects On Progress event.

yoni
06-27-2003, 03:49 PM
no worries. I figured it out.

yoni
06-27-2003, 04:00 PM
on this same topic. I'm having a little trouble stoping and starting the mp3 at the right time. When the stop button is clicked it sets the progress variable. However it does this in the hh:mm:ss format whereas the seek function only recognizes seconds. Is there a simple expression i can use to reformat the variable to seconds?

Worm
06-27-2003, 04:05 PM
I don't know about simple, but something like this maybe:

%Hours% = String.GetDelimitedString ("%Progress%", "::", 0)
%Hours% = Evaluate (%Hour% * 3600)
%Minutes% = String.GetDelimitedString ("%Progress%", "::", 1)
%Minutes% = Evaluate (%Minutes% * 60)
%Seconds% = String.GetDelimitedString ("%Progress%", "::", 2)
%Seconds% = Evaluate (%Seconds% + %Minutes% + %Hours%)

yoni
06-27-2003, 06:10 PM
worked great after adding a -1 (i guess ittakes a second to stop the mp3 somewhere internally.) Thanks for the help. I hadn't really used strings before but that was well explained.