ArmDeveloperEcosystem / microphone-library-for-pico

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

Use Micropython With microphone library #12

Closed alirezadigi closed 2 years ago

alirezadigi commented 2 years ago

Hi. How can i use micropython firmware alongside a Max9814 , with this module? Any Solutions?

I have written the code below but cant hear clear voice in audacity...

from machine import Pin, ADC
import ustruct , time

analog_value = machine.ADC(26)
conversion_factor =3.3/(65536)

samples = []

while True:
    reading = analog_value.read_u16()*conversion_factor   
samples.append(int(reading)) #print("ADC: ",reading)
time.sleep(0.002)

with open('Voice.bin', 'wb') as output:
     for sample in samples:
        output.write(struct.pack('<h', sample))
alirezadigi commented 2 years ago

Or even use this microphone library near MicroPython...

sandeepmistry commented 2 years ago

Hi @alirezadigi,

You would have to create a Native machine .mpy file which bridges this library to MicroPython.

This is out of scope of this project.

alirezadigi commented 2 years ago

@sandeepmistry thanks sorry can you please help me with the python code? ...

sandeepmistry commented 2 years ago

Hi @alirezadigi, unfortunately since it is out of scope for this project, I cannot help with your request.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.