- Raspberry Pi
- TJbot
- SD card
- Microphone
- Speaker
The following steps are applicable on three main computer OS: Linux, macOS and Windows.
- Download the latest image of Raspian.
- Download the latest Etcher to burn the image.
- Burn the image to SD card and boot RPi.
Open terminal in RPi and type the following commands.
- Update RPi system
sudo apt-get update
sudo apt-get dist-upgrade
- Set the audio output to 3.5mm jack
sudo raspi-config
7 Advanced Options -> A4 Aduio -> 1 Force 3.5mm ('headphone') jack -> Ok
- Install nodejs on RPi
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install nodejs
- (Optional) Install espeak for running tjdemo-espeak.js
sudo apt-get install espeak
- Tune audio volume
alsamixer
Press <Esc> to exit.
Go to this website and register a new account. Note that a new account is free for 30 days.
Log in to Bluemix Web UI.
Set the Region, Organization, Space.
ex.
Create Service -> Watson -> Speech-To-Text-Service -> Plan: Standard
Speech-To-Text service -> Service credntials -> New credential -> View credentials
ex.
{
"url": "https://stream.watsonplatform.net/speech-to-text/api",
"username": "512e2a10-4411-4900-90af-947d0f339070",
"password": "mUyesb3fl7oB"
}
Install Bluemix CLI(Cloud Foundry)
Open the terminal in your computer(Command Prompt for Windows users).
cf login -a https://api.ng.bluemix.net
cf create-service speech_to_text standard my-stt-service
cf create-service-key my-stt-service
cf servic-key my-stt-service my-stt-key
- Clone this project and change the working diretory into src.
git clone https://github.com/YuanYouYuan/cave-tjbot.git
cd cave-tjbot/src
- Install node dependencies
npm install
- Edit the credential in config.js
nano config.js
- Run the sample code
sudo node tjdemo-google.js