Node >= 12
Yarn
ffmpeg
MongoDB (only required if you want to save the results between calls)
- Edit the .env files according to your needs (development.env, production.env)
- Dev:
yarn install && yarn start:dev
- Prod
yarn install && yarn build && yarn:prod
POST - /api/video
id<string>: the id of a youtube video.
The app will first check if this given ID was already processed in the past, if so it will reutrn the BPM right away, based on the value stored on the DB, otherwise it will:
- Download the video
- Stream it to AudioContextApi as a buffer
- Pass this buffer to music-tempo
- Get the bpm
- save on the DB
- Return the entity with the bpm
- Deletes the .mp3 used to yield the stream