This project focuses on harnessing the power of Speech-to-Text (STT) technology to offer an interactive web-based application centered around voice interactions.
- Download the
python
if there does not already exist cd COMP30022-IT-Project
pip install -r requirements.txt
(orpip3 install -r requirements.txt
)
- Go to the MongoDB website and sign in with your account
- Create a new cluster with the server that is close to your location (e.g. Sydney)
- Create a new database called "Robot"
- Add collections ("API","Command","User") into the "Robot" database. You do not need to insert any data into the collections, but make sure the names of the three collection are correct.
- Enter the website: https://cloud.google.com/speech-to-textLogin.
- Login your google account and click "Try it free". Register your Google Cloud account.
- Click "Go to console" and create a Google Cloud Project
- Enter the "APIs and services/Library" in the navigation menu drop-down menu in the top-left corner. Search for "Cloud Speech-to-Text API " and enable the API.
- Enter the "APIs and services/Credentials". Click the "Create Credential" and create a service account.
- Click the created account in "Service account", then enter the "KEYS" tab. Add a new json key (A json file would be downloaded).
- Move the json file into the project root directory. In app.py, Substitute "path/of/the/json" with your json file path.
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = 'path/of/the/json'
- Create a new file in the root named
.env
- Fill in the environment
OPENAI_API_KEY = <Your OpenAI API Key>
- Create a new file named
config.py
and fill it with your database configuration The template is:
# MongoDB-URL Template:
# mongodb+srv://<username>:<password>@<connection name>.xxxxxxxx.mongodb.net
# which can be seen in the 'connection' tab on the mongodb server
MONGO_URI ="<MongoDB-URI>/Robot"
MONGO_DBNAME = "Robot"
SECRET_KEY = "<Your secret key>"
- Start running:
flask run
(orpython3 app.py
)
- Open the request.py
- Replace the audio file with your own
- Run
python request.py