Code: Select all
EnableExplicit
Enumeration 100
#Window
#WebView
EndEnumeration
OpenWindow(#Window, 100, 100, 400, 200, "Test", #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
WebViewGadget(#WebView, 0, 0, 400, 200)
SetGadgetItemText(#WebView, #PB_WebView_HtmlCode, ~"<script>ctx = new AudioContext(); osc = ctx.createOscillator(); osc.type = 'sine'; osc.frequency.value = 1; osc.connect(ctx.destination);</script>")
WebViewExecuteScript(#WebView, ~"osc.start();")
Repeat
Define Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
A similar "issue" also exists with PlaySound(#Sound, #PB_Sound_Loop) which inhibits Windows Sleep ...
EDIT:
I believe the issue is with my Realtek Audio driver and not any code or PB ...
powercfg -requests
SYSTEM:
[DRIVER] Realtek High Definition Audio
An audio stream is currently in use.
