Skip to content

yongfrank/SmartSpeaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Speaker based on GPT by OpenAI

Based on the refined OpenAI models and extensive research on user needs, this project aimed to select a speech implementation framework that could meet the requirements of embedded systems.

We utilized Python Flask and React Socket.io to achieve seamless communication between the front-end web page and back-end server, visualizing GPT texts on the web page, and integrating Azure and OpenAI GPT models to accomplish speech recognition and synthesis.

During the implementation process, we identified compatibility issues arising from differences in ARM32 and ARM64 architectures and restructured the code to ensure compatibility, resulting in a score of 95 points for the final project.

graph LR;
    word((Trigger Word));
    asr[Automatic\nSpeech Recognition];
    nlp[Natural\nLanguage Processing]
    gpt[Generative\nPre-trained Transformer];
    tts[Text-To-Speech]
    sound((Sound))

    word --> asr --> nlp --> gpt --> tts --> sound;
Loading

Video Link: Twitter

Demo Link: Smart Speaker

GPT-Screenshot

Table Of Content

Characteristics

Example Questions

  • Prompt: Write a tagline for an ice cream shop.
    • Completion: We serve up smiles with every scoop!
  • Suggest one name for a horse.
    • Lightning
  • Suggest one name for a black horse.
    • Midnight
  • Suggest three names for a horse that is a superhero.
    1. Super Stallion
    2. Captain Colt
    3. Mighty Mustang
$ Suggest three names for an animal that is a superhero.
Animal: Cat
Names: Captain Sharpclaw, Agent Fluffball, The Incredible Feline
Animal: Dog
Names: Ruff the Protector, Wonder Canine, Sir Barks-a-Lot
Animal: Horse

Names: Super Stallion, Mighty Mare, The Magnificent Equine

Steps

Step 4. Change TEST_MODE to True or IS_RASPBERRYPI in server/utils/config.py(Important), connect url in client/src/app.js(Optional)

Step 4. run sh start.sh or server - app.py and client - npm start

Installation

run install.sh or follow the steps

PyAudio

Installation error on macOS

# src/pyaudio/device_api.c:9:10: fatal error: 'portaudio.h' file not found
brew install portaudio
pip3 install pyAudio

# Linux
sudo apt install python3-pyaudio

# https://stackoverflow.com/questions/58974116/how-to-install-libasound2-dev-32-bit-without-using-apt-get
sudo apt-get install libportaudio2

picovoice.ai

pip3 install pvporcupine
pip3 install pvcobra

Azure Speech Service

sudo apt-get update
sudo apt-get install build-essential libssl-dev libasound2 wget
pip install azure-cognitiveservices-speech

dotenv

cd ./code && mv .env.example .env
pip3 install python-dotenv
PICOVOICE_AI_KEY=${YOUR-PICOVOICE-AI-KEY}
SPEECH_KEY=${MICROSOFT-AZURE-SPEECH-KEY}
SPEECH_REGION=${MICROSOFT-AZURE-SPEECH-REGION}

Reference

Services

Articles

About

Smart Speaker powered by OpenAI, MS Azure, Picovoice.ai

Resources

Stars

Watchers

Forks

Packages

No packages published