Play sound without blocking system sleep?

64 views
Skip to first unread message

Paul Marks

unread,
May 23, 2023, 10:19:33 AM5/23/23
to Chromium Extensions
I just made this extension that uses an offscreen document with AudioContext + createOscillator() to play an inaudible sound in order to stop my speakers from popping when the audio system changes its power state, when my Chromebook is connected to an external monitor.


This completely solves my sound problem, but I notice that when I leave my Chromebook sitting idle, the device no longer turns off the monitor and enters standby.

Is there some way to play sound (or otherwise keep the sound system from sleeping) without interfering with the Chrome OS systemwide sleep/wake cycle?  It's fine if the sound stops while the Chromebook itself is asleep.

Paul Marks

unread,
May 23, 2023, 12:56:04 PM5/23/23
to Chromium Extensions, Paul Marks
Never mind, I think I fixed the problem by monitoring the 'chrome.idle' API:
Reply all
Reply to author
Forward
0 new messages