# Animism Align a text to an audio file. ## Installation First, install miniconda and node. ``` conda create env -f environment.yml npm install ``` ## Generating waveform peaks Make sure your source sound is encoded as a 192 kbps CBR MP3 (for accurate time sync), then generate the peaks: ``` ffmpeg -i original.wav -ar 44100 -b:a 192k ../data_store/peaks/episode_99.mp3 ./cli.py peaks parse -i original.wav ``` ## Running the site Before running the commands, enter the client directory, load the Conda environment, and make sure the database is current: ``` cd cli conda activate animism ./cli.py db upgrade head ``` Then build the frontend and run the Flask server: ``` npm run build ./cli.py flask run ``` The server will be running on http://0.0.0.0:5000/ ## Development Monitor the Javascript for changes (run in another window): ``` npm run watch ``` Generate a new migration if you've modified the database: ``` ./cli.py db revision --autogenerate -m 'describe the changes' ./cli.py db upgrade head ``` ## Export For production, export a static version of the episode. This will make an exported folder in `data_store/exports/` which you can zip and upload somewhere. ``` ./cli.py site export -o animism ./cli.py viewer run ``` * The viewer will be running on e.g. http://0.0.0.0:5000/episode1/index.html * Currently no `index.html` resolution is performed. * For now, the site structure entails: ``` /index.html # redirects to first episode /episode1/index.html # episode player /episode1/media/... # all episode media copied here /static/ # non-site-media, fonts, etc ``` Watch the production JS: ``` NODE_ENV=production node ./node_modules/webpack-cli/bin/cli.js --config ./webpack.config.site.js -o /Users/user/work/animism/animism-align/data_store/exports/animism/episode1/bundle.js --watch ``` ## History - 2020.05 - Received designs from Other Means - 2020.06 - Development begins - 2020.10 - Audio re-recorded - 2020.11 - Site launches with Episode 1