Measure phone audio and test an offline PWA
Compare relative microphone levels and frequency bins, then verify that the app and its records survive an offline reload.

Physics Phoebe: I want the sound, placement and permission notes together before you compare the records.
Predict the reading, then compare it with the measurement.
Phone browser (Web APIs)
Phone browserOpen the lab on your phone over HTTPS, then use its permission button.
Open the phone lab (new tab)Steps
Step 1
- Do
- Open the prepared phone page over HTTPS while online. Wait for Offline copy ready. Install it from the browser menu if offered, or keep the tab.
- You will see
- Input: Opened the phone page online in mobile Chromium. Observed: “Secure context ready. Microphone needs your permission.” appears. Expected: The service worker should cache the shell before an offline reload. Interpretation: The page reports “Offline copy ready. Go offline, then reload to test it.”
- Why it matters
- Evidence: The real browser loaded the page and service-worker state. Boundary: Ready to cache does not yet prove offline operation. Reason: Microphone permission is separate from network reachability. Next check: Start the declared test-tone input through the browser API.

Step 1 · Phone browser (Web APIs); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 2
- Do
- In the microphone controls panel, tap Start microphone and allow access. Keep the microphone uncovered in a quiet room.
- You will see
- Input: Started Chromium’s fake microphone with an emulated 440 Hz, 0.2-peak tone in a real browser. Observed: “Permission granted. Microphone running” and -17.0 dBFS appear. Expected: Web Audio should report a finite relative RMS value. Interpretation: This is browser test input, not room sound or calibrated dB(A).
- Why it matters
- Evidence: getUserMedia and Web Audio AnalyserNode processed the injected tone. Boundary: dBFS is relative to digital full scale, not sound pressure. Reason: The browser’s microphone permission and a live track were exercised. Next check: Inspect peak frequency with the FFT setting recorded.

Step 2 · Phone browser (Web APIs); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 3
- Do
- Make a gentle hum at a fixed distance and watch the spectrum. Read the strongest bin and sample rate.
- You will see
- Input: Kept the emulated 440 Hz tone on the real browser microphone API. Observed: The page shows 44,100 Hz sample rate and FFT 2048. Observed: It reports 21.5 Hz per bin, a 46.4 ms window, and 430.7 Hz strongest bin. Interpretation: The nearest reported bin differs from the injected tone at this grid size.
- Why it matters
- Evidence: The live Web Audio spectrum was read from the browser page. Boundary: The tone is emulated input, not an environmental sound measurement. Reason: FFT bins discretize the displayed peak. Next check: Increase FFT size while keeping the same tone and placement.

Step 3 · Phone browser (Web APIs); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 4
- Do
- In the FFT size field, change FFT size from 2048 to 4096, keeping the phone and sound unchanged.
- You will see
- Input: Selected FFT 4096 with the same emulated 440 Hz browser input. Observed: The page shows 44,100 Hz sample rate and FFT 4096. Observed: Bin spacing becomes 10.8 Hz, window 92.9 ms, peak 441.4 Hz. Interpretation: Finer bins use a longer time window for the same input.
- Why it matters
- Evidence: Only the page’s FFT selector changed during this comparison. Boundary: Closer bin placement alone does not prove two tones are resolved. Reason: Doubling samples roughly halves bin spacing and doubles window length. Next check: Save both setting and context with the snapshot.

Step 4 · Phone browser (Web APIs); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 5
- Do
- In the snapshot note field, write the phone placement and the sound comparison in the note. Tap Save a snapshot and inspect the latest record.
- You will see
- Input: Saved the emulated-tone comparison in the real browser with phone-on-table context. Observed: The page says “1 saved records. Local only; nothing is sent.” Expected: The record should retain measurement, source, permission, and settings. Interpretation: It shows Web Audio AnalyserNode, 44,100 Hz, FFT 4096, and “unreviewed”.
- Why it matters
- Evidence: The latest record was opened on the real page after saving. Boundary: The -17.0 dBFS level is relative and not calibrated SPL. Reason: The stored context supports a later comparison without raw audio. Next check: Stop input and test whether the cached page survives offline.

Step 5 · Phone browser (Web APIs); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 6
- Do
- In the microphone controls panel, stop the microphone. Turn off Wi-Fi and mobile data, then reload this same page.
- You will see
- Input: Stopped the microphone, disabled the browser network, and reloaded. Observed: The page says “Offline reload verified: this page came from the cached app.” Expected: The prior local snapshot should remain after the offline reload. Interpretation: The page still shows one saved record while offline.
- Why it matters
- Evidence: This was a real service-worker reload under Playwright offline mode. Boundary: Cached UI and local storage do not validate a sound measurement. Reason: The app shell and record persistence are separate from sensor consent. Next check: Request microphone input again while the browser stays offline.

Step 6 · Phone browser (Web APIs); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 7
- Do
- In the microphone controls panel, while still offline, tap Start microphone and allow access if asked. Verify a level, save a second snapshot, then tap Stop microphone. Reconnect, download your JSON if needed, and clear the records.
- You will see
- Input: Restarted the real browser microphone API offline with the emulated 440 Hz tone. Observed: The second local record has network “offline” and a non-null measurement. Expected: Stopping should end the microphone track and mark its value stale. Interpretation: The page says “Stopped. Microphone off. Last reading is not live.”
- Why it matters
- Evidence: The offline save and ended-track checks passed in this browser run. Boundary: The stopped -17.0 dBFS readout is no longer live room evidence. Reason: Network and microphone permission are independent. Next check: Reconnect, download JSON if needed, then clear local records.

Step 7 · Phone browser (Web APIs); numbered callout added to a real capture. Enlarge screenshot (new tab)
Chapter checks
These questions refer to the chapter’s examples. Use the return links to review their answers.
A participatory noise survey receives phone readings with no location context or permission state. How should the dataset treat them?
Return to the chapter’s knowledge checkA class collects phone-based sound observations, but some records lack timestamp, access state, and phone placement notes. What is the strongest review feedback before comparing the submissions?
Return to the chapter’s knowledge check