Flashlight signaling safety
Audio Reactive Mode
Public safety, source notes, and device-boundary documentation for Strobotorch.
Audio Reactive Mode
Audio Reactive Mode implements the plan in strobotorchaudio.txt through the
public Android audio APIs that can run inside the app.
Implemented Sources
- Microphone / ambient audio:
AudioRecord. - Phone playback: Android 10+
AudioPlaybackCaptureConfigurationwith a user-approvedMediaProjectionsession. - Output mix: optional
Visualizer(0)source for rough, low-quality meters.
Before any Android permission prompt, the app shows an in-app explanation of
what it is asking for and why. It requests RECORD_AUDIO for audio sources and
does not request CAMERA. Internal playback capture also requires a separate
Android screen/audio capture consent prompt because playback capture is mediated
through MediaProjection.
The microphone permission is used to compute local features such as loudness, bass energy, onset confidence, and timing. Playback capture is used only to request capturable app audio from Android. Strobotorch does not save recordings, screen video, or raw samples by default. Internal playback capture remains subject to Android and source-app capture policy.
Implemented DSP
- RMS and peak amplitude.
- dB estimate.
- Silence detection.
- Simple bass / mid / treble energy.
- Spectral flux estimate.
- Onset confidence.
- Lightweight BPM estimate after stable onsets.
- Feature smoothing.
No raw samples are saved or transmitted by default.
Implemented Mapping
- Ambient / brightness follower: loudness to brightness where torch strength is supported.
- Bass pulse: bass energy to safe pulse frequency.
- Beat accent: onset confidence to short accents.
- Point-away lab mapping: requested high-rate pulse diagnostics up to 60 Hz.
- User controls for requested frequency range and brightness range.
- A general point-away gate that enables torch output for audio-reactive modes.
- Optional temporal fractal-dimension bias for the requested command trace.
- Rolling Higuchi D and PSD-beta analysis of the mapped command trace.
The dynamic path is:
AudioInputSource -> AudioFeatureExtractor -> AudioToTorchMapper
-> AudioReactiveSafetyLimiter -> RollingFractalTraceAnalyzer
-> TorchCommandRateLimiter -> TorchDriver
Meters can run without torch output. Torch output requires the “Pointed away from people” acknowledgement. Without that gate, direct-viewing mappings are capped at 3 flashes per second and the torch switch stays unavailable.
Point-away mappings can request up to 60 Hz and the selected brightness range, but those values are still requested command rates, not measured optical output.
Fractal-dimension controls are also command-trace controls. The analysis window reports the app’s normalized requested torch level over time; it does not measure optical LED output.
Audio-reactive torch output is for point-away signaling and diagnostics only. Do not stare into the flashlight or use audio-reactive mode to induce visual effects. See Flashing Light Safety for the public warning and source background.
Deliberately Optional
The native Oboe / miniaudio / KISS FFT phase remains optional. The Kotlin v1 keeps the project dependency-light and auditable; native modules can be added later without changing the safety model.