I needed a white noise app to help a family member sleep, but all the existing ones had upsells. This mostly worked but Apple doesn't let PWAs play audio via the Web Audio APIs when locked.
This project hit the edges of PWA capabilties, so I didn't ever get to use it much personally. But it demonstrates some cool browsers APIs such as:
- 🔊 Web Audio API
- 🎚️ Media Sessions API
- 📱 Progressive Web App / Service Workers
- 🧸 Zustand State Management Even though I used a destructing anti-pattern O_O
I unknownly re-invented jackyef's project here, which I found later.
Creating seamless looping audio requires using the Web Audio API, as of writing. Using the Audio APIs to play sound instead of standard HTML markup allowed for EQ controls as well.
View on "Soundsleeper" repo on Github
It also utilizes the Media Sessions API to allow for audio control via the Mac menu bar, as well on the lock screen for supported devices.
It's up for now at soundsleeper.app, but I'll probably let it expire since I'm not using it at the moment.