document on readme
parent
0e28b183e4
commit
19b4a99d96
64
README.md
64
README.md
|
@ -2,17 +2,67 @@
|
|||
|
||||
Welcome to the Mimic Recording Studio.
|
||||
|
||||
![demo](demo.gif)
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Dependencies
|
||||
* [Docker](https://docs.docker.com/) (community edition is fine)
|
||||
* [Docker-compose](https://docs.docker.com/compose/install/)
|
||||
|
||||
### Build and Rum
|
||||
* `git clone `
|
||||
* [Docker](https://docs.docker.com/) (community edition is fine)
|
||||
* [Docker Compose](https://docs.docker.com/compose/install/)
|
||||
|
||||
Why docker? To make this super easy to set up and run cross platforms.
|
||||
|
||||
### Build and Run
|
||||
|
||||
* `git clone https://github.com/MycroftAI/mimic-recording-studio.git`
|
||||
* `cd mimic-recording-studio`
|
||||
* `docker-compose up`
|
||||
* In browser go to `http://localhost:3000`
|
||||
* `docker-compose up` to build and run
|
||||
* Alternatively, you can build and run seperately. `docker-compose build`, `docker-compose up`
|
||||
* In browser, go to `http://localhost:3000`
|
||||
|
||||
**Note**
|
||||
First run will require
|
||||
First `docker-compose up` will take a while as this command will also build the docker containers. Subsequent `docker-compose up` should be quicker to boot.
|
||||
|
||||
## Data
|
||||
|
||||
### Saved Audios
|
||||
|
||||
Audios can be found in the `backend/audio_file/{uuid}` directory. The backend automatically trims the beginning and ending silence for all wav files using [ffmpeg](https://www.ffmpeg.org/).
|
||||
|
||||
### Corpus
|
||||
|
||||
Right now, we have an english corpus, `english_corpus.csv` made available which can be found in `backend/prompt/`. To use your own corpus follow these steps.
|
||||
|
||||
1. create a csv file in the same format as `english_corpus.csv` using tabs (`\t`) as the delimitter.
|
||||
2. change the `CORPUS` environment variable in `docker-compose.yml` to your corpus name.
|
||||
|
||||
## Technologies
|
||||
|
||||
### Frontend
|
||||
|
||||
The web UI is built using javascript and [React](https://reactjs.org/) and [create-react-app](https://github.com/facebook/create-react-app) as a scaffolding tool.
|
||||
|
||||
#### Functions
|
||||
|
||||
* Record and play audio
|
||||
* Display audio visualization
|
||||
* Calculate and display metrics
|
||||
|
||||
### Backend
|
||||
|
||||
The web service is built using python, [Flask](http://flask.pocoo.org/) as the backend framework, [gunicorn](https://gunicorn.org/) as a http webserver, and [sqlite](https://www.sqlite.org/index.html) as the database.
|
||||
|
||||
#### Functions
|
||||
|
||||
* Process audio
|
||||
* Serves corpus and metrics data
|
||||
* Record info in database
|
||||
|
||||
### Docker
|
||||
|
||||
Docker is used to containerized both applications. By default, frontend uses network port `3000` while the backend uses networking port `5000`. You can configure these in the `docker-compose.yml` file.
|
||||
|
||||
## Contributions
|
||||
|
||||
PR's are accepted!
|
|
@ -4,9 +4,12 @@ import os
|
|||
import csv
|
||||
import hashlib
|
||||
import subprocess
|
||||
import os
|
||||
from subprocess import DEVNULL
|
||||
from .protocol import response
|
||||
|
||||
corpus_name = os.environ["CORPUS"]
|
||||
|
||||
prompts_dir = prompts_path = os.path.join(
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"../prompts/"
|
||||
|
@ -14,7 +17,8 @@ prompts_dir = prompts_path = os.path.join(
|
|||
os.makedirs(prompts_dir, exist_ok=True)
|
||||
prompts_path = os.path.join(
|
||||
prompts_dir,
|
||||
"../prompts/english_prompts_v2.csv"
|
||||
"../prompts",
|
||||
corpus_name
|
||||
)
|
||||
|
||||
audio_dir = os.path.join(
|
||||
|
|
Can't render this file because it is too large.
|
|
@ -1 +1 @@
|
|||
gunicorn -w 4 -b 0.0.0.0:5000 app:app -c gunicorn_conf.py --capture-output
|
||||
gunicorn -w $WEBWORKERS -b 0.0.0.0:$APIPORT app:app -c gunicorn_conf.py --capture-output
|
||||
|
|
|
@ -8,6 +8,10 @@ services:
|
|||
- "5000:5000"
|
||||
volumes:
|
||||
- ./backend/:/src
|
||||
environment:
|
||||
- CORPUS=english_corpus.csv
|
||||
- APIPORT=5000
|
||||
- WEBWORKERS=1
|
||||
frontend:
|
||||
container_name: mrs-frontend
|
||||
build:
|
||||
|
|
Loading…
Reference in New Issue