From 74244ebef3e3e4cbd9af50ca19af2affb39ba0f1 Mon Sep 17 00:00:00 2001 From: RblSb Date: Wed, 12 Feb 2025 11:33:18 +0300 Subject: Add /volume command --- src/client/Utils.hx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/client/Utils.hx') diff --git a/src/client/Utils.hx b/src/client/Utils.hx index a120166..9217e07 100644 --- a/src/client/Utils.hx +++ b/src/client/Utils.hx @@ -7,6 +7,7 @@ import js.Browser.window; import js.html.Element; import js.html.FileReader; import js.html.URL; +import js.html.audio.AudioContext; import js.lib.ArrayBuffer; class Utils { @@ -205,4 +206,10 @@ class Utils { final observer = (window : Dynamic).ResizeObserver ?? return null; return js.Syntax.code("new ResizeObserver({0})", callback); } + + public static function createAudioContext():Null { + final w:Dynamic = js.Browser.window; + final ctx = w.AudioContext ?? w.webkitAudioContext ?? return null; + return js.Syntax.code("new {0}()", ctx); + } } -- cgit v1.2.3