A custom application to validate/annotate short audio segments for creating a spoken language identification dataset.
- Python 3
- Conda/Pip
- Npm/Node
Clone/download the code. For example:
git clone https://github.com/jorgenvvv/audio_validatorIt probably is wise to create a new virtual environment with conda or venv to install the dependencies and run the application.
conda create -y --name audio_validator python==3.7Install the backend dependencies from the requirements.txt file with pip/conda.
pip install -r requirements.txtThere is an example config.example.py file in the root of the repository. Rename this file (or create a new one) to config.py and fill in the required details.
The values that should definitely be changed or added to the example config file are the following (others can be left as defaults):
JWT_SECRET_KEY- a secret key for JWT authentication between the frontend and backendGOOGLE_AUTH_CLIENT_IDandGOOGLE_AUTH_CLIENT_SECRET- these are needed for the Google sign in option and can be obtained from https://console.developers.google.comAUDIO_PATH- path where the audio files are stored that will be used in the validation processAUDIO_METADATA_PATH- path where metadata for the previously set audio files is located
Navigate to the frontend directory and install the dependencies with npm.
npm installFor running the app in development mode run:
npm run serveTo build the app for production run:
npm run buildThen the built files should be placed at the root of the code in a directory named /dist, from where they will be served by the backend when in production.
Currently the application is configured to be served on a url ending with /lid_validate. To change that edit the frontend/vue.config.js file and change the value of "publicPath".
In production the frontend expects the backend to be running on port 5000 by default. To change that edit the frontend/env.production file and change the port of VUE_APP_API_URL.
For development the backend can be started by running:
FLASK_APP=audio_validator
FLASK_ENV=development
flask runIn production something like Waitress (as shown in the Flask documentation) should be used. Using waitress for starting the app in production would look like:
waitress-serve --call --port 5000 audio_validator:create_app