Duration of track and cycle mp3 file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Duration of track and cycle mp3 file

LemonParty
Hello.
I managed to load library in my project. I have 2 questions:
1. How to get a duration of a mp3 file?
2. How to cycle playing of a mp3 file?
Reply | Threaded
Open this post in threaded view
|

Re: Duration of track and cycle mp3 file

fredvs
Administrator
Hello LemonParty and welcome to uos forum.

>1. How to get a duration of a mp3 file?

var
 tottime: ttime;
 ho, mi, se, ms: word;

 tottime := uos_InputlengthTime(theplayer, Inputindex1);
 DecodeTime(tottime, ho, mi, se, ms);

>2. How to cycle playing of a mp3 file?

Hum, sorry but what is cycle playing, is it playing with loop at each end?
Reply | Threaded
Open this post in threaded view
|

Re: Duration of track and cycle mp3 file

LemonParty
I want a mp3 file to start playing from the begining when it comes to end until user let's say don't press the button.
Reply | Threaded
Open this post in threaded view
|

Re: Duration of track and cycle mp3 file

fredvs
Administrator
>I want a mp3 file to start playing from the begining when it comes to end until user let's say don't press the button.

uos_Play(theplayer, -1);   // -1 = loop forever, otherwise num of loop before stop

When you want to stop the loop with the button: uos_Stop(theplayer);
Reply | Threaded
Open this post in threaded view
|

Re: Duration of track and cycle mp3 file

LemonParty
Great! Thank you.