diff --git a/js/playSound.js b/js/playSound.js index 318f54a..5afb1f6 100644 --- a/js/playSound.js +++ b/js/playSound.js @@ -17,6 +17,7 @@ app.registerExtension({ } const url = new URL(`assets/notify.mp3`, import.meta.url); const audio = new Audio(url); + audio.volume = this.widgets[1].value; audio.play(); }; } diff --git a/py/play_sound.py b/py/play_sound.py index 5fa0700..e2e6cf1 100644 --- a/py/play_sound.py +++ b/py/play_sound.py @@ -14,6 +14,7 @@ class PlaySound: return {"required": { "any": (any, {}), "mode": (["always", "on empty queue"], {}), + "volume": ("FLOAT", {"min": 0, "max": 1, "step": 0.1, "default": 0.5}) }} FUNCTION = "nop" @@ -26,8 +27,8 @@ class PlaySound: def IS_CHANGED(self, **kwargs): return float("NaN") - def nop(self, any, mode): - return {"ui": {"a":[]}, "result": ()} + def nop(self, any, mode, volume): + return {"ui": {"a": []}, "result": ()} NODE_CLASS_MAPPINGS = {