ArmDeveloperEcosystem / microphone-library-for-pico

Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. 🎤
Apache License 2.0
231 stars 47 forks source link

Stereo. Could it be done? #11

Open dimwap opened 2 years ago

dimwap commented 2 years ago

2 mic => stereo... How many reworks will it take to make the sound stereo?

sandeepmistry commented 2 years ago

Hi @dimwap,

Did you want this feature for the analog microphones or PDM microphones?

I anticipate a few changes needed to support this feature:

  1. The context would need to be updated so that it is passed into each API. Currently this is one static instance.

  2. For PDM microphones, there are two options:

    1. Have two instances of the microphone

    2. Or update the PIO state machine code to clock in data on both rising and falling edges, using the mic's SEL pin to select if the microphone is right or left.

There could be some performance issues for PDM microphones, as the filtering algorithm needs to run fast enough to process the raw data in real-time. For i) a work around could be to have one microphone per core.

Maybe we can use #3 to track this request?

dimwap commented 2 years ago

Did you want this feature for the analog microphones or PDM microphones?

I understand that difficulties are possible. Therefore, it will suit any option where a stereo microphone is possible, Analog or otherwise.