How to modify an output sample rate while playing ?

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

How to modify an output sample rate while playing ?

Lulu
Hi Fred,
I started playing with uos_flat, but for my need, I can find a way to modify the output sample rate while the audio is playing. I don't want to use SoundTouch like in one uos demo, but if it's possible, I would like to modify directly the record field:

Tuos_Player.StreamOut[].Data.SampleRate

How could I an access to the record 'Data' ?

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

Re: How to modify an output sample rate while playing ?

fredvs
Administrator
This post was updated on .
Hello Lulu.

It is not possible to change the sample-rate while playing, even if you try with uos.pas, it will not work.

Of course you may change the sample-rate before play but once it is done it is not possible, you need a DSP method to do it.
SoundTouch is a DSP that does it very well.

If you dont want to use SoundTouch or a DSP, a possible workaround would be, when you want to change the rate, catch the position of the player1, stop it, create a other player2 of the same file, go to position of closed first player, change the rate and play that new player2 from that position.

And do a kind of "ping-pong" between those 2 players each time a change rate is needed.

But you can imagine that this could not perfectly be synchro between the 2 players.

Yes, I know, something that seems very easy with analogic sound is not so easy in digital samples.

Fre;D

Reply | Threaded
Open this post in threaded view
|

Re: How to modify an output sample rate while playing ?

fredvs
Administrator
In reply to this post by Lulu
> How could I an access to the record 'Data' ?

The most easy and safe is via DSP procedure.
Please take a look into "SimplePlayer" demo, there are examples of DSP: stereo to mono, play reverse, ...

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: How to modify an output sample rate while playing ?

Lulu
Thanks for the clarification. i will look at the demo.
regards