Go Down

Topic: Sampling audio and streaming (Read 408 times) previous topic - next topic

arduinogogo

Hello,

I've setup an Arduino to sample audio through the analogue input pin at a set frequency and am sending this 8-bit HEX sample out through the USB serial device. On the other end the samples are collected, combined and saved into a .raw file.

Have I misunderstood or should I be able import this into audacity as raw audio as unsigned 8 bit PCM with a custom sample rate.

The audio is being amplified and offset to be between 0-5v.

Thanks

DVDdoug

Quote
should I be able import this into audacity as raw audio as unsigned 8 bit PCM with a custom sample rate.
That should work.   With 8-bit mono you simply have a series of bytes, and about the only thing that could go wrong is mixing-up signed & unsigned values.

Oh...  The Arduino's ADC is 10-bits.  Did you scale-down to 8-bits?  (Divide by 4, or bit-shift left by 2?) 

If there is a problem, try DC (maybe 5V and 0V) or a very-low-frequency square wave.   Then, open the file with a Hex Editor and look at the bytes.

Go Up