fredvs
My posts
Account settings
Log out

Duration of track and cycle mp3 file

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

Duration of track and cycle mp3 file

LemonParty
7 posts
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
| More
Print post
Permalink

Re: Duration of track and cycle mp3 file

fredvs
Administrator
718 posts
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
| More
Print post
Permalink

Re: Duration of track and cycle mp3 file

LemonParty
7 posts
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
| More
Print post
Permalink

Re: Duration of track and cycle mp3 file

fredvs
Administrator
718 posts
>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
| More
Print post
Permalink

Re: Duration of track and cycle mp3 file

LemonParty
7 posts
Great! Thank you.