Best way to play a list of files

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

Best way to play a list of files

Killerbee
Hello

Just a general question:
What is the best way to play a list of mp3 files?

As far as I know the only way is to put this in a loop:

Create player
Create output
(Create DSP)
(Set Volume)
Add song
Play song

But is there a different way something like:

Create player
Create output
(Create DSP)
(Set Volume)
Add song 1
Add song 2
Add song 3
Add song 4
Add song 5
Play songs (with Crossfade)

Thanks
KB
Reply | Threaded
Open this post in threaded view
|

Re: Best way to play a list of files

fredvs
Administrator
Hello.

Huh, I do not know if there is a best way to play list.

But, IMO, I should use the same "trick" than in uos-demo : MorseTL (morse translator).

It set as "EndProc" the new song to play.

But maybe I did not understand well what you want.

Fre;D  

Reply | Threaded
Open this post in threaded view
|

Re: Best way to play a list of files

fredvs
Administrator
This post was updated on .
Hello.

If you want to cross-fade (start playing before end of song), you may use a DSP:

uos_InputSetPositionEnable(PlayerIndex1, InputIndex1, 1);
uos_InputAddDSP(PlayerIndex1, InputIndex1, nil, @CrossFadeDSP nil, nil);


And CrossFadeDSP function will be something like:

function CrossFadeDSP(Data: TuosF_Data; fft: TuosF_FFT): TDArFloat;
  begin
    if uos_InputPosition(PlayerIndex, InputIndex) > uos_InputLength(PlayerIndex, InputIndex) - whenmuststart
 then uos_Play(2);
  end;

----------------

You may use also LoopEndProc:

uos_InputSetPositionEnable(PlayerIndex1, InputIndex1, 1);
uos_LoopEndProc(PlayerIndex 1, CrossFadeLoop);


Here example for CrossFadeLoop:

Procedure CrossFadeLoop;
  begin
   if uos_InputPosition(PlayerIndex, InputIndex) > uos_InputLength(PlayerIndex, InputIndex) - whenmuststart
 then uos_Play(2);
 end;


Fre;D