# Setting up an Open Speech Recording Website

## Overview

https://youtu.be/dThkbDCOoKk

If you've played with the TensorFlow Lite microspeech model, you will quickly get a little tired of the same word pairs that it comes with. There's just so much yes/no before you want to create your _own_ wake/watch words!

This guide will show you how to setup your own Open Speech Recording website, [just like the one Pete Warden used](https://github.com/petewarden/open-speech-recordinghttps://arxiv.org/abs/1804.03209) to [collect all the words in the speech data set](https://ai.googleblog.com/2017/08/launching-speech-commands-dataset.html)

# Setting up an Open Speech Recording Website

## Cloud Software Setup

If you don't already have a google cloud account, visit [https://cloud.google.com/](https://cloud.google.com/) to make an account and sign up for the free trial - you will not end up needing to pay for the amount of storage/compute this project requires.

![](https://cdn-learn.adafruit.com/assets/assets/000/079/070/medium800/hacks_freetrial.png?1565052493)

Under GCP (Google Cloud Platform), make a new project

![](https://cdn-learn.adafruit.com/assets/assets/000/079/063/medium800/hacks_makenewproj.png?1565052206)

Check the project is made in your project list!

![](https://cdn-learn.adafruit.com/assets/assets/000/079/065/medium800/hacks_gcloudprojmade.png?1565052282)

Next up, **create a new GCP Cloud Storage bucket** to store all the audio files! Select the existing project you've made

Next up, **create a new GCP Cloud Storage bucket** to store all the audio files! Select the existing project you've made

![hacks_createbucker.png](https://cdn-learn.adafruit.com/assets/assets/000/079/072/medium640/hacks_createbucker.png?1565052598)

![hacks_cloudstorageproj.png](https://cdn-learn.adafruit.com/assets/assets/000/079/076/medium640/hacks_cloudstorageproj.png?1565052673)

Pick a bucket name, we used the project name with **-output** at the end

![hacks_bucketname.png](https://cdn-learn.adafruit.com/assets/assets/000/079/073/medium640/hacks_bucketname.png?1565052689)

For ACL, we set bucket-level access control

![hacks_bucketacl.png](https://cdn-learn.adafruit.com/assets/assets/000/079/078/medium640/hacks_bucketacl.png?1565052806)

Finally make it Multi-regional (default)

![hacks_bucketregion.png](https://cdn-learn.adafruit.com/assets/assets/000/079/074/medium640/hacks_bucketregion.png?1565052712)

Finally, your bucket exists, and we can keep going

![](https://cdn-learn.adafruit.com/assets/assets/000/079/080/medium800/hacks_bucketmade.png?1565052826)

# Setting up an Open Speech Recording Website

## Speech Recorder Setup

# Install Google Cloud SDK
[Download the Google Cloud SDK, and install it.](https://cloud.google.com/sdk/docs/)

Open up a terminal and run **gcloud init**

![](https://cdn-learn.adafruit.com/assets/assets/000/079/058/medium800/hacks_gcloudinit.png?1565051898)

Log into the browser window that pops up

![hacks_gcloudlogin.png](https://cdn-learn.adafruit.com/assets/assets/000/079/059/medium640/hacks_gcloudlogin.png?1565051954)

And grant permissions

![hacks_gcloudperm.png](https://cdn-learn.adafruit.com/assets/assets/000/079/061/medium640/hacks_gcloudperm.png?1565052017)

After you're authenticated, the SDK will ask you to pick the project you want to work on

![](https://cdn-learn.adafruit.com/assets/assets/000/079/067/medium800/hacks_gcloudpick.png?1565052371)

You'll next be asked to pick a region, for this kinda project it doesn't matter where you pick so go with whatever is close to you.

![](https://cdn-learn.adafruit.com/assets/assets/000/079/068/medium800/hacks_gcloudset.png?1565052384)

Finally, you're configured!

![](https://cdn-learn.adafruit.com/assets/assets/000/079/069/medium800/hacks_gcloudconfiged.png?1565052429)

# Configure Software

Fork/clone the [https://github.com/petewarden/open-speech-recording/](https://github.com/petewarden/open-speech-recording/) repository to your local computer, and go to that directory in your terminal

![](https://cdn-learn.adafruit.com/assets/assets/000/079/081/medium800/hacks_forkit.png?1565053637)

Edit your local copy of **app.yaml** in the repo, change the cloud storage bucket to match the name you made earlier. For session secret key generate a random hex string. It's used to authenticate the session, and has nothing to do with the bucket authentication.

![](https://cdn-learn.adafruit.com/assets/assets/000/079/082/medium800/hacks_image.png?1565053715)

Edit **static/scripts/app.js** and find the **wantedWords** and **fillerWords** arrays and change them to whatever words you want to prompt for

![](https://cdn-learn.adafruit.com/assets/assets/000/079/098/medium800/hacks_image.png?1565055362)

Finally, run **pip install -t lib -r requirements.txt**

![](https://cdn-learn.adafruit.com/assets/assets/000/079/083/medium800/hacks_pipreqs.png?1565053921)

# Local Deploy & Test

Before you upload up to GCP you can run the project locally! Run **dev\_appserver.py** from within the project folder

Due to my kinda messed up Python2/3 setup, I had to manually run **dev\_appserver.py** but either way, install the components

![hacks_py2appserver.png](https://cdn-learn.adafruit.com/assets/assets/000/079/088/medium640/hacks_py2appserver.png?1565054366)

Install the extensions as prompted, and if necessary, rerun the appserver script, and permit Python2 access to the network

![hacks_gcloudappserverinstalled.png](https://cdn-learn.adafruit.com/assets/assets/000/079/089/medium640/hacks_gcloudappserverinstalled.png?1565054391)

![hacks_appserverallow.png](https://cdn-learn.adafruit.com/assets/assets/000/079/090/medium640/hacks_appserverallow.png?1565054452)

Open up a browser and visit [http://localhost:8080/](http://localhost:8080/) to see the server setup, you should have an instance running

![](https://cdn-learn.adafruit.com/assets/assets/000/079/092/medium800/hacks_localserver.png?1565054525)

Click on **default** to load the website...it should look like this!

![hacks_osr.png](https://cdn-learn.adafruit.com/assets/assets/000/079/093/medium640/hacks_osr.png?1565054601)

# Deploy & Test

From the directory, in terminal, run **gcloud app deploy**. The first time you run it you'll be asked to setup the region

![](https://cdn-learn.adafruit.com/assets/assets/000/079/085/medium800/hacks_appdeploy.png?1565054099)

Select your local region

![](https://cdn-learn.adafruit.com/assets/assets/000/079/086/medium800/hacks_creatingapp.png?1565054138)

Type Y to continue the deployment!

![](https://cdn-learn.adafruit.com/assets/assets/000/079/094/medium800/hacks_deployed.png?1565054660)

Finally, visit the URL in question or just type **gcloud app browse**

![](https://cdn-learn.adafruit.com/assets/assets/000/079/084/medium800/hacks_gcloudbrowse.png?1565054084)

The site is now live!

![hacks_image.png](https://cdn-learn.adafruit.com/assets/assets/000/079/096/medium640/hacks_image.png?1565054768)

# Check Recordings

After you use the open recording app, visit the output bucket you made, you should see many **ogg** files one for each utterance

![](https://cdn-learn.adafruit.com/assets/assets/000/079/097/medium800/hacks_image.png?1565054888)


## Related Guides

- [ TensorFlow Lite for EdgeBadge Quickstart](https://learn.adafruit.com/tensorflow-lite-for-edgebadge-kit-quickstart.md)
- [PyBadge Case with Flip Out Mic](https://learn.adafruit.com/pybadge-case-with-flip-out-mic.md)
- [SNES EZ Key Bluefruit Game Pad](https://learn.adafruit.com/snes-ez-key-bluefruit-game-pad.md)
- [Biometric Lock Box](https://learn.adafruit.com/biometric-security-box.md)
- [How to Make Animated Graphics for Hologram Displays](https://learn.adafruit.com/how-to-make-animated-graphics-for-hologram-displays.md)
- [Vintage computer to HDMI with Feather DVI & CircuitPython](https://learn.adafruit.com/vintage-computer-to-dvi-with-feather-dvi-circuitpython.md)
- [Glowing Skullcandy Headphones Mod](https://learn.adafruit.com/glowing-skullcandy-headphones-mod.md)
- [Whistle Dog Activity Monitor Teardown](https://learn.adafruit.com/whistle-dog-activity-monitor-teardown.md)
- [Authoring Playground Books with Bluefruit for iOS ](https://learn.adafruit.com/create-a-swift-playgroundbook-with-bluetooth-le.md)
- [Fruit Jam Sega Genesis](https://learn.adafruit.com/fruit-jam-sega-genesis.md)
- [3D Print Link's Hylian Shield](https://learn.adafruit.com/3d-print-links-hylian-shield.md)
- [Spruce Up a Costume with MONSTER M4SK Eyes and Voice](https://learn.adafruit.com/spruce-up-a-costume-with-monster-m4sk-eyes-and-voice.md)
- [No-Code IKEA Vindriktning Air Quality Sensor Hack with Adafruit IO](https://learn.adafruit.com/no-code-ikea-vindriktning-hack-with-qt-py-esp32-s3-and-adafruit-io.md)
- [Haunted Air Blaster](https://learn.adafruit.com/automated-air-blaster.md)
