NaomiProject / Naomi

The Naomi Project is an open source, technology agnostic platform for developing always-on, voice-controlled applications!
https://projectnaomi.com/
MIT License
242 stars 47 forks source link

Fix record and playback during install #376

Closed aaronchantrill closed 1 year ago

aaronchantrill commented 1 year ago

Description

installers/naomi-setup.sh - Replace tabs with spaces

naomi/commandline.py - If default option is not available when selecting from a list, don't suggest a default

naomi/application.py - Don't load visualizations twice (caused duplicate visualizations). Set default vad from snr_vad to webrtc_vad. Fixed some formatting issues. Used "mic.play_file_sync" to play the beep showing that Naomi heard because the "mic.play_fp" started playing the captured voice data right afterward.

naomi/populate.py - Minor formatting issues

naomi/visualizations.py - clear current visualizations before loading, prevents duplicate visualizations.

plugins/audioengine/pyaudio-ae/pyaudioengine.py - noted problem with switching stream properties before previous stream has finished playing. Probably need to move to SoundDevice for audio.

plugins/stt/pocketsphinx-stt/g2p.py - cleaned up output

plugins/visualizations/terminal/terminal.py - Use system time when printing timestamp, not Naomi's timezone (which is part of the "clock" plugin).

python_requirements.txt - swap scikit-learn for sklearn.

Related Issue

Naomi crashes if it tries to play a file with different attributes than the one it is currently playing #375 Record voice and playback not working during initial setup #374 sklearn breaks installer #371

Motivation and Context

This is a grab bag of fixes for things I ran into while preparing pull request 373 - New Pocketsphinx install procedure.

I think the first issue, "sklearn breaks installer" was fixed by PyPi. I've never seen an issue like that before and it was very annoying. It seemed like someone got over zealous about pushing the updated scikit-learn library. The other issues are minor and only really affected the ability to test your hardware setup by recording your voice and playing it back.

How Has This Been Tested?

I will test this on a raspberry pi 4 before merging it.

Screenshots (if appropriate):

Types of changes

Checklist:

aaronchantrill commented 1 year ago

I tested this branch on my Raspberry Pi 4 at home last night and it fixed the problems described and allowed me to get all the way through the install. I did have some trouble getting the chime to play after setting the output audio device, and when I tried to have the sound played again it aborted. I'm not sure why that is, but I don't think either of these are new issues, so I'm going to go ahead and merge this.