What's the right way to do??? resample??
I am a beginner on Linux audio programming.
When recording from one audio codec and playing
back from another audio codec in real time, there must be some asynchronous problems.(Buffer overrun for recording or buffer underrun for playback). I believe this problem must have some answers. Hence should I resample audio in real time dynamically so that asynchronous conditions would be eliminated? If so, what resample library would be suitable?? Libsamplerate or Libresample???
Thanks if anyone can give me some hints.
(My recording device is 8000HZ and my playback device also works at 8000HZ)
Signature · 8 lines
The sun is shinny but the ice is slippery. ------------------------------------------------------- This SF.net email is sponsored by Demarc: A global provider of Threat Management Solutions. Download our HomeAdmin security software for free today! http://www.demarc.com/Info/Sentarus/hamr30
Quoted 9 lines
When recording from one audio codec and playing
back from another audio codec in real time, there must be some asynchronous problems.(Buffer overrun for recording or buffer underrun for playback). I believe this problem must have some answers. Hence should I resample audio in real time dynamically so that asynchronous conditions would be eliminated? If so, what resample library would be suitable?? Libsamplerate or Libresample???
There is now software solution to this problem, because software has no way to figure out, when/how much two hardware pieces get out of sync. You have to sync your hardware for input and output. That either means you have to use a hardware which provides both input and output and full duplex access or you have to use an external word clock cable to synchronisation. Then on the software side you can be sure, that your output will always consume the exact amount of data the input has just generated.
Signature · 10 lines
---> doj / cubic ----> http://cubic.org/~doj -----> http://llg.cubic.org ------------------------------------------------------- This SF.net email is sponsored by Demarc: A global provider of Threat Management Solutions. Download our HomeAdmin security software for free today! http://www.demarc.com/Info/Sentarus/hamr30
Quoted 6 lines · Dirk Jagdmann
You have to sync your hardware for input and output. That either means you have to use a hardware which provides both input and output and full duplex access or you have to use an external word clock cable to synchronisation. Then on the software side you can be sure, that your output will always consume the exact amount of data the input has just generated.
Thanks.
Actually I record from bt878 and play it back on AC97. So what do you mean by "external world clock" in this case? Is /dev/rtc an sort of external world clock? Or you just mean there is no solution without hardware modifications in such a case??
Signature · 8 lines
The sun is shinny but the ice is slippery. ------------------------------------------------------- This SF.net email is sponsored by Demarc: A global provider of Threat Management Solutions. Download our HomeAdmin security software for free today! http://www.demarc.com/Info/Sentarus/hamr30
Quoted 10 lines · Joe Hsu
Quoted 6 lines · Dirk Jagdmann
You have to sync your hardware for input and output. That either means you have to use a hardware which provides both input and output and full duplex access or you have to use an external word clock cable to synchronisation. Then on the software side you can be sure, that your output will always consume the exact amount of data the input has just generated.
Actually I record from bt878 and play it back on AC97. So what do you mean by "external world clock" in this case?
In this case, there is no word clock; the hardware would have to support it.
Quoted 2 lines
Or you just mean there is no solution without hardware modifications in such a case??
You could either connect the TV card's analog output to the line in of the AC97 so that both recording and playback use the same clock, or you could convert the sample rate in software. Most existing libraries like e.g. libsamplerate assume that you know the exact sample rate in advance, so you would have to write your own sample rate converter that can adjust it ratio dynamically.
Regards,
Clemens
-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions. Download our HomeAdmin security software for free today!
http://www.demarc.com/Info/Sentarus/hamr30