Help wanted. Use of USB mic numb & the TRRS jack for audio output...
al-jimenez opened this issue · comments
I am getting the below error. I am using a USB microphone numb and the TRRS jack for audio output. I would prefer not to modify and score the CHIP board. Is there a way of not getting this error if you DON'T modify the board?
NOTE: I have audio capture working and audio output working with arecord / aplay; Just get this error when I run python main.py:
Traceback (most recent call last):
File "main.py", line 127, in
with wave.open('beep.wav', 'rb') as f:
AttributeError: Wave_read instance has no attribute 'exit'
I am using a USB: C-Media Electronics, Inc. CM108 Audio Controller (Kinobo - USB 2.0 Mini Microphone "Makio" Mic from Amazon)
@al-jimenez I had that issue as well. I was able to get things working by running the main.py script in python3 and installing related python3/pip3 dependencies. Here are some thoughts:
- edit your main.py script based on this github code from jitto:
jitto@0604ac3 - apt-get install python3-pip
- pip3 install python3-memcached
- pip3 install pyalsaudio
- edit your /usr/share/alsa/alsa.conf file so that "pcm.front cards.pcm.front" is renamed "pcm.front cards.pcm.default"
- reboot
- run the setup_gpio.sh script at startup
- run python3 main.py
Reference the CHIP forum below for more details. I'm actually using the header pin MIC rather than USB mic so your implementation might be a little different.
https://bbs.nextthing.co/t/turning-the-chip-into-an-amazon-echo/1630/29
@1elbaz I got stuck at step 4. pip3 install pyalsaudio until I realize that this was a typo (after Googling). It should be:
- pip3 install pyalsaaudio
This project is now deprecated in favor of the new AlexaPi (https://github.com/alexa-pi/AlexaPi) which has all the features of this project and much more, such as:
- support for a wide range of devices and platforms (Raspberry Pi, CHIP, Orange Pi, desktops, Magic Mirror and others)
- voice activation (great PocketSphinx support and snowboy support soon to be released)
- much more robust installation and configuration
- better security
- Arch Linux support
- awesome documentation
- and much, much more! You get it - it's just awesome.
Please switch over to the new project and if your issue persists there, file an issue in the new repo's issue tracker. Thank you.