Hi guys,
I am totally new to the arduino world and I would like to know if it is possible to convert a 44.1Khz/16bit audio file or signal into 26.04Khz/12 bit one with the arduino or teensy ?
If so, then how please ?
Thanks
Hi guys,
I am totally new to the arduino world and I would like to know if it is possible to convert a 44.1Khz/16bit audio file or signal into 26.04Khz/12 bit one with the arduino or teensy ?
If so, then how please ?
Thanks
The problem with using an Arduino to do this is that there is not enough memory to store the audio file to be converted unless it is very very short. ( about a quarter of a second ).
One way is to use the free application called Audacity to do the file conversion. I am not sure however that a 12 bit resolution is one option though. What do you hope to achieve by this? It will take up as much memory as a 16 bit sample unless you pack the samples with two samples in three bytes. But then you will need to unpack them before you can play them.
The other way is to write some code that will do it on your PC. There is a good free language called "Processing" that you can do that with. The code is quite simple and involves you taking a sample and scaling it before storing it in the output buffer. Then the next sample is taken from an address that will give you the sample rate you want. This might involve using a none integer increment, of your address pointer to the next sample position, but only using the integer portion of it to get the actual address to use.
The question doesn't seem to have any relationship the the title of the thread.
A digital audio stream ("signal") and file can use the same underlying algorithm but they present different challenges.
So, what are you trying to accomplish?
The bit-depth is pretty easy... You just right-shift 4-bits (throwing-away the 4 least-significant bits and filling the 4 most-significant bits with zeros). If you are working with a file, you might want to normalize first so you don't "waste resolution" but that kinda' depends on what you're doing. And then you're stuck with one-and-a-half bytes worth of data, so you'll have to decide what to do with that.
The sample rate is more complicated than you might think because you have to low-pass filter before downsampling (to prevent aliasing).