Like the 7-minute workout, but with more exercises and with the workout order randomly generated each time you listen.
- iOS does not allow you to play sound from an HTMLAudioElement or the Web Audio API unless the play results from a user interaction. This breaks sequencing sounds because iOS will refuse to play a second sound programmatically after the first is done because there's no new user interaction. Even big fancy audio libraries break on iOS because of this. The only way to get around it is to recycle the same HTMLAudioElement or AudioContext and and update their source appropriately instead of creating new audio objects.
- You can't use mp3 files for seamless looped audio since mp3s always have a few milliseconds of silence added to the beginning and end. AAC/WebM/Ogg are better formats for loops depending on your browser compatibility needs.
- When looping an HTMLAudioElement, Safari adds a small delay between each loop. This doesn't sounds very good if you're looping a beat. In order to get seamless loops with no delay, you have to use the Web Audio API
- iOS has a bug which causes audio played through the Web Audio API to sound distorted when Safari is first launched. You have to force a sample rate of 44100hz to remove the distortion. Code fix is with the bug description.
- Use the Web Speech API instead of pre-recorded exercise name files
- Preload necessary audio
- Allow user to stop play and restart with new settings without waiting for the end of a workout or refreshing.
- Remember user's last settings
Add a selection of background beatsAllow user to start a new sequenceUse promises and async/await instead of recursion for sequencing audioAdd more exercisesAllow user to customize number of exercisesAdd a better UI for playing and pausingAllow user to customize time between exercices
- Gan Khoon Lay for the favicon
- Zlatko Najdenovski for the play icon
- Charlie Bob Gordon for the pause icon
- The Noun Project for helping me find them