I am looking to capture speech and save it as a wav (Wave PCM) in RPi. Ideally the speech should be captured in 8khz with 16bit resolution and saved as a raw file or wav file. I also have a need to capture multiple channels (ie 4 microphones simultaneously)


Is RPi an appropriate solution for this requirement? Or should I look at other options?

I know that RPi does not have an ADC, and some of the ADCs I saw in Adafruit does not have sufficient SPS to capture at 8khz. So any suggestions?

Any general tips/suggestions are also most welcome.

  • 1
    From what I've read 16 bit precision is going to be pretty tough to achieve (the implication seems to be it needs a very good circuit design with very stable power supply), Are you sure you can achieve 16 bit sampling precision?
    – joan
    Nov 17, 2014 at 14:38
  • You going to have real issues with this, especially 4 channels at the same time. Even connecting 4 USB sound cards produces clock issues and USB latency. Should stick to a PC with a PCI-Express Audio card that can support many inputs... not going to be under 50bucks but it will save you allot of troubles.
    – Piotr Kula
    Nov 17, 2014 at 21:06
  • You may only need two not four USB sticks provided you can actually find them with stereo INPUTs (many are stereo out only but mono in)! Direct 16-bit resolution is not realistic I think and if you are only using a 8KHz sampling rate your band-width is going to be less than half this - only a bit more than a (land-line) telephone.
    – SlySven
    Dec 23, 2015 at 4:18

1 Answer 1


Whether you can sample with 16 bit precision is down to your skills as a electronics engineer. I believe there is more to that than simply putting a 16-bit ADC into a circuit and hoping for the best. Perhaps 12-14 bit precision would be easier. That aspect is best answered in an electronics forum.

The standard Rapberry Pi Linux driver tops out at about 20 thousand SPI transactions per second (see http://www.raspberrypi.org/forums/viewtopic.php?p=594022#p594022 for an experiment of mine).

If you can read 4 channels from your ADC in one transaction then you could meet your 8ksps. However if your ADC (like most I've seen) only allows one channel to be read per transaction that would need 32 thousand transactions per second, which is beyond the capabilities of the standard SPI driver.

There is another issue. Do your samples need what I call temporal integrity, i.e. is it important that each sample is 1/8000 of a second (125µs) since the last one? If so Linux can't really deliver, the gaps will vary.

I can offer a solution to both problems. You can bypass Linux, use DMA to guarantee the timings, and bit-bang SPI to read 4 separate ADCs simultaneously. I have used that technique to read 2 ADCs at 25ksps with 40µs between reads. It should easily scale to 4 chips.

However my solution would probably require you to have better than average software skills. See http://www.raspberrypi.org/forums/viewtopic.php?f=44&t=71089

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.