A telop that says 「離席中です」 when the room goes quiet — one HTML file and an OBS browser source

obsUncategorized
スポンサーリンク
スポンサーリンク

What I built: a telop that says 「離席中です」 when the microphone stays quiet for 30 seconds

There is a small thing I have wanted for a long time.

When I leave my desk, the microphone does not know it. It keeps listening to the same empty room in exactly the same way. If I mute it by hand, then I have to remember to unmute it when I come back, and I forget more often than I like to admit.

So I wrote one small page. It watches how loud the microphone is, and it counts the seconds. When the sound stays below a level I chose for thirty seconds, it puts a telop on the screen: 離席中です, which means “I am away from my seat.” When the sound comes back, the telop fades out again.

I am writing this down for the people who search with the same words I searched with. In Japanese they are OBS マイク 無音 検知 テロップ — OBS, a silent microphone, detecting that silence, and a telop. I could not find a ready-made piece that did exactly this in the shape I wanted, so I wrote one myself. Perhaps someone else is looking for the same shape, and this note saves them an evening.

The whole thing is a single HTML file. A browser source in OBS reads it, and the microphone comes in through the browser’s own permission. There is nothing to install, and there is no server to run. The page also draws nothing but the words and a soft dark plate behind them, so it can sit on top of any scene.

One decision inside the code is worth saying out loud. The page asks for the microphone with echo cancellation, noise suppression and automatic gain control switched off. Those three are helpful for a call, and unhelpful for measuring silence: an automatic gain control will lift the quiet room up until it is not quiet any more, and then the telop never appears. If a browser refuses the detailed request, the code asks again in the plain way, so it still works, only a little less precisely.

The code to place: one HTML file, and how to load it into an OBS browser source

Save this as one file. The comments inside are mine, in Japanese.

コメント

タイトルとURLをコピーしました