A repeatable audio marker for debugging microphone bleed
If desktop audio appears in a microphone recording, a moving input meter tells you that something was captured. You still need to distinguish the playback from room noise, mouse clicks and the sound of your own keyboard. Use an identifiable signal and change one part of the routing between recordings.
Make the playback easy to recognize
Save this as marker.html and open it in a current desktop browser. Set your playback to a low, comfortable level first. The button schedules three sine tones on the audio clock. The tones last 120, 120 and 320 milliseconds, with short ramps to smooth their edges. The gain in the example controls the digital signal level. The loudness you hear depends on your output volume and equipment.
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Three-tone audio marker</title>
<button id="play" type="button">Play two short tones and one long tone</button>
<p id="status" role="status"></p>
<script type="module">
const button = document.querySelector('#play');
const status = document.querySelector('#status');
let audio;
function playPattern(context) {
const origin = context.currentTime + 0.05;
const notes = [[0, 0.12, 620], [0.28, 0.12, 620], [0.75, 0.32, 430]];
return Promise.all(notes.map(([offset, duration, frequency]) => {
const start = origin + offset;
const end = start + duration;
const tone = context.createOscillator();
const envelope = context.createGain();
tone.frequency.value = frequency;
envelope.gain.setValueAtTime(0, start);
envelope.gain.linearRampToValueAtTime(0.05, start + 0.01);
envelope.gain.setValueAtTime(0.05, end - 0.01);
envelope.gain.linearRampToValueAtTime(0, end);
tone.connect(envelope);
envelope.connect(context.destination);
return new Promise(resolve => {
tone.addEventListener('ended', () => {
tone.disconnect();
envelope.disconnect();
resolve();
}, { once: true });
tone.start(start);
tone.stop(end);
});
}));
}
button.addEventListener('click', async () => {
button.disabled = true;
status.textContent = 'Playing the marker…';
try {
audio ??= new AudioContext();
await audio.resume();
await playPattern(audio);
status.textContent = 'Marker finished.';
} catch (error) {
status.textContent = `Playback failed (${error.name}).`;
} finally {
button.disabled = false;
}
});
</script>
</html>
The click handler resumes the audio context in response to a user action. Once it resumes, the oscillator start and stop times share the same audio clock. The gaps help you recognize the pattern by ear. They cannot tell you when the sound reached the mic capsule.
Record the same marker on each route
- Open the SoundTesters Microphone Test in a window beside the marker. Keep both windows visible because the microphone test stops capture when its page becomes hidden. In Windows and in the test page, write down the selected input device. Leave Hear myself live off.
- Record a speech check first and listen to it. If you cannot hear your voice, correct the input selection before interpreting a quiet result. Then start a fresh capture and click the marker once while your speakers are the active output. Stay quiet. Choose Finish & listen, then listen to the sample and write down whether you hear the two short tones followed by the longer tone.
- Repeat with headphones. If possible, connect headphones without introducing a headset microphone or changing the input device. Verify the input name once more. Keep the marker and capture settings fixed, and confirm playback is audible in the headphones before recording. Listen to each sample before starting the next capture.
- If your reported problem involves short keyboard sounds, repeat both runs with a single reference sample from the KeyboardTester.click Keyboard Sound Test. Set Type to hear and Loop sample off. Choose the same sample and click Play sample in both runs. This avoids confusing a real mechanical key press with playback of the reference file.
| Observation | Follow-up |
|---|---|
| You hear the matching pattern with speakers, and it fades or disappears with headphones. | An acoustic route is plausible. The headphone change also may have changed the playback endpoint. For a stronger control, keep the same OS output and turn down the speaker using its own hardware volume, if it has a separate control. |
| You hear the matching pattern on both runs. | Check whether the app is capturing a playback or virtual input, or whether an analog headset connection is coupling output into the mic input. Headphone sound can also leak acoustically. |
| You can hear your voice, but the marker is absent on both runs. | Repeat in the app with the original problem. It may use another input or a separate desktop audio capture track. Noise suppression, automatic gain and echo cancellation can change what this browser recording includes. |
If you get inconsistent results, keep the same microphone and repeat the speaker run once before changing another setting. A change in the capture shows where to investigate next. It does not identify a specific driver, cable or device by itself.
For Windows device selection, Stereo Mix and app-specific follow-up, see the original KeyboardTester.click Windows 11 desktop audio guide. The MDN Web Audio autoplay guide covers starting playback from a user gesture.
KeyboardTester.click and SoundTesters share an owner. This adaptation was written with AI assistance.
About the author
- Founder and Developer of http://keyboardtester.click
Comments
Join the discussionNo comments yet. Be the first to comment.



