Reputation: 2155
I'm trying to install pyalsaaudio
on my Raspberry PI Pico board.
Firmware for my board I have build myself from micropython repo using documentation on how to do it from raspberry.
In documentation for micropython there is a section about Installing packages with mip but mip
package is missing
>>> import mip
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'mip'
Another way I tryed to install this package was via Thonny package manager, but again, with no positive results.
error:
Failed to build pyalsaaudio
Error Command
'['C:\\Users\\<username>\\AppData\\Local\\pipkin\\cache\\workspaces\\fa71e45a1e41e660688341b77ee2813a\\Scripts\\python.exe', '-I', '-m', 'pip', '--no-color', '--disable-pip-version-check', '--trusted-host', '127.0.0.1', 'install', '--no-compile', '--use-pep517', '--upgrade-strategy', 'only-if-needed', 'pyalsaaudio', '--index-url', 'http://127.0.0.1:36628']' returned non-zero exit status 1.
Is there another way to install this package?
Or is there other package that will allow me to record audio from microphone?
Upvotes: 0
Views: 4295
Reputation: 6284
Do you have a Pico or a Pico W? The Pico doesn't have a network interface of its own, so the standard firmware won't include mip
. It looks as if mip
was added to the Pico W port fairly recently, so you might need to check you have a recent build.
However, pyalsaaudio
is a Python wrapper for the ALSA library which runs under the Linux operating system. The Pico boards (like most microcontroller boards used with MicroPython) don't have an operating system and can't have ALSA, so pyalsaaudio is no help here.
How is the audio source connected to your Pico? If it's on an analogue input (with suitable signal conditioning) you should be able to capture audio into memory with ADC.read_timed
. If you need more help than that I would try asking in MicroPython's GitHub Discussions which has replaced the older forum.
Upvotes: 1