|
| 1 | +# AudioLab: Web Audio Forensics and Tracking Analysis |
| 2 | + |
| 3 | +> Record Web Audio API calls to study audio fingerprint collection techniques and verify privacy protection. |
| 4 | +
|
| 5 | +--- |
| 6 | + |
| 7 | +<a id="prerequisites"></a> |
| 8 | + |
| 9 | +## Prerequisites |
| 10 | + |
| 11 | +- **BotBrowser** installed and running. See [Installation Guide](../../../INSTALLATION.md). |
| 12 | +- **A profile file** (`.enc` for production). |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +<a id="quick-start"></a> |
| 17 | + |
| 18 | +## Quick Start |
| 19 | + |
| 20 | +Record all Web Audio API calls to a JSONL file: |
| 21 | + |
| 22 | +```bash |
| 23 | +chromium-browser \ |
| 24 | + --bot-profile="/path/to/profile.enc" \ |
| 25 | + --bot-audio-record-file=/tmp/audiolab.jsonl \ |
| 26 | + --user-data-dir="$(mktemp -d)" \ |
| 27 | + "https://example.com" |
| 28 | +``` |
| 29 | + |
| 30 | +After the session, `/tmp/audiolab.jsonl` contains every Web Audio API call the page made. Open it in the [Audio Viewer](https://botswin.github.io/BotBrowser/docs/tools/audiolab/audio_viewer.html) to inspect events interactively. |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +<a id="how-it-works"></a> |
| 35 | + |
| 36 | +## How It Works |
| 37 | + |
| 38 | +When `--bot-audio-record-file` is set, BotBrowser intercepts every Web Audio API call at the browser engine level and writes it to a JSONL file. Each line is a JSON object representing one API call, including: |
| 39 | + |
| 40 | +- **Event type**: `context_create`, `node_create`, `param_set`, `connect`, `start`, `start_rendering`, `read_channel_data`, `analyser_read`, `codec_check`, and more |
| 41 | +- **Full parameters**: all arguments serialized (node types, parameter values, timing, sample previews) |
| 42 | +- **Audio graph topology**: which nodes connect to which, showing the complete signal routing |
| 43 | +- **Data extraction**: sample previews (first 10 + last 10 values), sums, frequency data, codec results |
| 44 | +- **Execution context**: sequence number, timestamp, process/thread ID, source URL |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +<a id="common-scenarios"></a> |
| 49 | + |
| 50 | +## Common Scenarios |
| 51 | + |
| 52 | +### Record and analyze with Playwright |
| 53 | + |
| 54 | +```javascript |
| 55 | +import { chromium } from "playwright-core"; |
| 56 | + |
| 57 | +const browser = await chromium.launch({ |
| 58 | + executablePath: process.env.BOTBROWSER_EXEC_PATH, |
| 59 | + headless: true, |
| 60 | + args: [ |
| 61 | + `--bot-profile=${process.env.BOT_PROFILE_PATH}`, |
| 62 | + "--bot-audio-record-file=/tmp/audiolab.jsonl", |
| 63 | + ], |
| 64 | +}); |
| 65 | + |
| 66 | +const page = await browser.newPage(); |
| 67 | +await page.goto("https://example.com"); |
| 68 | +// Let the page run its audio fingerprinting |
| 69 | +await page.waitForTimeout(5000); |
| 70 | +await browser.close(); |
| 71 | + |
| 72 | +// Now inspect /tmp/audiolab.jsonl |
| 73 | +``` |
| 74 | + |
| 75 | +### View recordings in the Audio Viewer |
| 76 | + |
| 77 | +Open the HTML-based viewer to inspect recordings interactively: |
| 78 | + |
| 79 | +1. Navigate to the [Audio Viewer](https://botswin.github.io/BotBrowser/docs/tools/audiolab/audio_viewer.html) |
| 80 | +2. Load your `.jsonl` file |
| 81 | +3. Browse events, view the audio graph topology, and inspect extracted data |
| 82 | + |
| 83 | +### Identify which fingerprinting recipe a site uses |
| 84 | + |
| 85 | +The Audio Viewer automatically detects known recipes: |
| 86 | + |
| 87 | +```bash |
| 88 | +# Record a site's audio fingerprinting |
| 89 | +chromium-browser \ |
| 90 | + --bot-profile="/path/to/profile.enc" \ |
| 91 | + --bot-audio-record-file=/tmp/audiolab.jsonl \ |
| 92 | + --user-data-dir="$(mktemp -d)" \ |
| 93 | + "https://target-site.com" |
| 94 | + |
| 95 | +# Quick check: what context parameters were used? |
| 96 | +cat /tmp/audiolab.jsonl | jq 'select(.type == "context_create")' |
| 97 | +# The viewer auto-detects common patterns from context parameters |
| 98 | +``` |
| 99 | + |
| 100 | +### Inspect extracted audio data |
| 101 | + |
| 102 | +```bash |
| 103 | +# See what data the tracker extracted |
| 104 | +cat /tmp/audiolab.jsonl | jq 'select(.type == "read_channel_data")' |
| 105 | + |
| 106 | +# Check codec probing |
| 107 | +cat /tmp/audiolab.jsonl | jq 'select(.type == "codec_check")' |
| 108 | +``` |
| 109 | + |
| 110 | +### Cross-platform protection validation |
| 111 | + |
| 112 | +Record the same page on multiple platforms and compare the JSONL output to verify that BotBrowser's noise produces consistent protection: |
| 113 | + |
| 114 | +```bash |
| 115 | +# Record on Linux host |
| 116 | +chromium-browser \ |
| 117 | + --bot-profile="/path/to/win-profile.enc" \ |
| 118 | + --bot-audio-record-file=/tmp/audiolab-linux.jsonl \ |
| 119 | + --user-data-dir="$(mktemp -d)" \ |
| 120 | + "https://example.com" |
| 121 | + |
| 122 | +# Compare with recording from macOS host |
| 123 | +diff /tmp/audiolab-linux.jsonl /tmp/audiolab-macos.jsonl |
| 124 | +``` |
| 125 | + |
| 126 | +### Record audio and canvas simultaneously |
| 127 | + |
| 128 | +```bash |
| 129 | +chromium-browser \ |
| 130 | + --bot-profile="/path/to/profile.enc" \ |
| 131 | + --bot-audio-record-file=/tmp/audiolab.jsonl \ |
| 132 | + --bot-canvas-record-file=/tmp/canvaslab.jsonl \ |
| 133 | + --user-data-dir="$(mktemp -d)" \ |
| 134 | + "https://example.com" |
| 135 | +``` |
| 136 | + |
| 137 | +--- |
| 138 | + |
| 139 | +<a id="troubleshooting"></a> |
| 140 | + |
| 141 | +## Troubleshooting / FAQ |
| 142 | + |
| 143 | +| Problem | Solution | |
| 144 | +|---------|----------| |
| 145 | +| JSONL file is empty | Ensure the page actually uses Web Audio APIs. Try a known fingerprint test site like [CreepJS](https://abrahamjuliot.github.io/creepjs/). | |
| 146 | +| File path not writable | Use an absolute path and ensure the directory exists. BotBrowser does not create parent directories. | |
| 147 | +| Only codec_check events appear | The page may only test codec support (canPlayType/isTypeSupported) without rendering audio. This is normal for some tracking systems. | |
| 148 | +| Missing analyser_read events | Not all fingerprinting patterns use AnalyserNode. Some recipes only read channel data. | |
| 149 | + |
| 150 | +--- |
| 151 | + |
| 152 | +<a id="next-steps"></a> |
| 153 | + |
| 154 | +## Next Steps |
| 155 | + |
| 156 | +- [AudioLab Documentation](../../../tools/audiolab/). Complete reference including recording format, event types, and viewer usage. |
| 157 | +- [Audio Fingerprinting](../fingerprint/AUDIO.md). Configure audio noise and rendering consistency. |
| 158 | +- [CanvasLab](CANVASLAB.md). Similar forensics tool for Canvas 2D, WebGL, and WebGL2. |
| 159 | +- [CLI Flags Reference](../../../CLI_FLAGS.md#--bot-audio-record-file). Flag documentation. |
| 160 | + |
| 161 | +--- |
| 162 | + |
| 163 | +**Related documentation:** [AudioLab Tool](../../../tools/audiolab/) | [CLI Flags: --bot-audio-record-file](../../../CLI_FLAGS.md#--bot-audio-record-file) |
| 164 | + |
| 165 | +--- |
| 166 | + |
| 167 | +**[Legal Disclaimer & Terms of Use](https://github.com/botswin/BotBrowser/blob/main/DISCLAIMER.md) - [Responsible Use Guidelines](https://github.com/botswin/BotBrowser/blob/main/RESPONSIBLE_USE.md)**. BotBrowser is for authorized fingerprint protection and privacy research only. |
0 commit comments