- Clone GitHub Repository
git clone git@github.com:Spehhhhh/EEE380.git
- Switch to the directory
cd EEE231
# This project uses pipenv to manage the virtual environment.
# Install Poetry
$ curl -sSL https://install.python-poetry.org | python3 -
# Set environment variables
$ echo 'export PATH="$HOME/.poetry/bin:$PATH"' >> ~/.zshrc
# Install package
$ poetry install
# Activate the virtual environment for the current project
$ poetry shell
# Generate lockfile
$ poetry lock --no-update
# Run the main program
$ poetry run python <files>
# MacBook M1 Only
# install pyaudio
brew install portaudio
python -m pip install --global-option='build_ext' --global-option='-I/opt/homebrew/Cellar/portaudio/19.7.0/include' --global-option='-L/opt/homebrew/Cellar/portaudio/19.7.0/lib' pyaudio
# install vosk-api
./scripts/vosk-macos.sh
# https://github.com/Uberi/speech_recognition/pull/592/commits/467224e845e9b6ef25bef84494bd240d58429933
# python3.10/site-packages/speech_recognition/__init__.py
# install vosk-api
def recognize_vosk(self, audio_data, language='en'):
from vosk import KaldiRecognizer, Model
assert isinstance(audio_data, AudioData), "Data must be audio data"
if not hasattr(self, 'vosk_model'):
if not os.path.exists("model"):
return "Please download the model from https://github.com/alphacep/vosk-api/blob/master/doc/models.md and unpack as 'model' in the current folder."
exit (1)
self.vosk_model = Model("model")
rec = KaldiRecognizer(self.vosk_model, 16000);
rec.AcceptWaveform(audio_data.get_raw_data(convert_rate=16000, convert_width=2));
finalRecognition = json.loads(rec.FinalResult())
if finalRecognition['text'] == '' :
return ''
else:
return finalRecognition['text']
- Install PlatformIO Core
http://docs.platformio.org/page/core.html
- Download development platform with examples
https://github.com/platformio/platform-atmelavr/archive/develop.zip>
- Extract ZIP archive
- Run these commands:
# Change directory
$ cd <path>
# Build project
$ platformio run
# Upload firmware
$ platformio run --target upload
# Build specific environment
$ platformio run -e uno
# Upload firmware for the specific environment
$ platformio run -e uno --target upload
# Clean build files
$ platformio run --target clean
- Class Naming Convention:
CapWords
- Class Member Convention:
lower_with_under_
- Function Naming Convention:
lower_with_under()
- Variables Naming Convention:
lower_with_under
TODO
TODO
GNU General Public License v3.0
TODO
- 220109 init