Playing only the beginning of a recording

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

Playing only the beginning of a recording

Sc0li0sis
Can I play only a specific number of seconds/minutes of an MP3 file?

Best regards,
Sc0li0sis
Reply | Threaded
Open this post in threaded view
|

Re: Playing only the beginning of a recording

fredvs
Administrator
This post was updated on .
Hello Sc0li0sis and welcome to the uos forum.

You may do it via the uos_LoopProcIn() procedure.

If you take the uos SimplePlayer demo:

First add your stoptime, at line 125:

var
stoptime:  ttime;

then define it, adding at line 499 ( to stop after 1 second 500 ms )
stoptime := EncodeTime(00,00,01,500);

Finally update the uos_LoopProcIn() // procedure LoopProcPlayer1:
add this at line 710:
if uos_InputPositionTime(PlayerIndex1, Inputindex1) >= stoptime then uos_Stop(PlayerIndex1);

This will stop the player at stoptime.
Reply | Threaded
Open this post in threaded view
|

Re: Playing only the beginning of a recording

fredvs
Administrator
Ooops, for the uos demo  SimplePlayer the stop time is a bit too big ( the demo songs are < 1 sec 500 ) so
better to use something like stoptime := EncodeTime(00,00,01,50); to test.
Reply | Threaded
Open this post in threaded view
|

Re: Playing only the beginning of a recording

Sc0li0sis
Thank you so much for your quick response. I'll test it when I get home.

Fredvs, you're amazing.

Sc0li0sis
Reply | Threaded
Open this post in threaded view
|

Re: Playing only the beginning of a recording

Sc0li0sis
It worked,
Thanks a lot again.

Sc0li0sis
Reply | Threaded
Open this post in threaded view
|

Re: Playing only the beginning of a recording

fredvs
Administrator
Nice!  
You are welcome.
Fre;D