Add volume

This commit is contained in:
pythongosssss
2023-08-05 22:35:56 +01:00
parent 6f1cea74cf
commit a79e6d0fa5
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -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();
};
}
+3 -2
View File
@@ -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 = {