Does It Work Offline? What "In Your Browser" Really Means
Short answer: Half. Once the page is open, the sound is made on your own device, so it should keep playing if the connection drops. But you can't open the page without a connection. I haven't built the part that would save it for offline use.
What "in your browser" means
Most sound on the web is sent to you. A server holds a file and your device plays it as it arrives. If the connection goes, the sound stops.
My app works the other way. The page contains the instructions for making sound, and your device follows them. No audio travels over the network at any point. I went into that in there are no audio files.
So a train going into a tunnel shouldn't matter. Everything needed to keep playing is already on your device.
What does need a connection
- Opening the page. The first load comes from the internet like any other page. So does a reload.
- Buying the extra worlds. Forest and Space are paid, and paying happens online like any purchase.
- Anonymous analytics. The page uses cookies for anonymous analytics and says so in a line at the bottom. It also keeps a simple count of my own: visits, which world is playing, how long people listen. If the connection is gone these fail quietly and the sound carries on.
I want to be plain about that last point. "The sound is made on your device" is true. "Nothing is ever sent" would not be. No sound is sent, in either direction. The page never uses your microphone. Usage counts are sent.
What it would take to work fully offline
Browsers have a tool for this, called a service worker. MDN describes service workers as acting like "proxy servers that sit between web applications, the browser, and the network", and lists creating "effective offline experiences" as their first purpose. In plain words: a small helper that keeps a copy of the page, so it can open without a connection.
My app doesn't have one yet. It is one small page with no audio files, so I'd expect it to be a good fit. I haven't done the work.
So, in practice
| Situation | What I'd expect |
|---|---|
| Connection drops while it's playing | Sound keeps going |
| You open the page with no connection | It doesn't load |
| You reload with no connection | It probably doesn't load |
| Flight mode, page opened before boarding and left open | Sound keeps going |
These are what the way it's built tells me to expect. I'd rather say that than claim I have tested every phone.
Sources
Try it: Open Ambient Sound Online and start Ocean, which is free. Then switch your wifi off for a minute and listen.
Open Ocean, free