Pages: [1]   Go Down
Author Topic: Sampling audio and streaming  (Read 365 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Edison Member
*
Karma: 32
Posts: 1282
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: