diff --git a/src/lang.json b/src/lang.json index 2d21fe8..6a8307a 100644 --- a/src/lang.json +++ b/src/lang.json @@ -404,6 +404,9 @@ "x82IOl": { "defaultMessage": "Mute" }, + "y867Vs": { + "defaultMessage": "Volume" + }, "yzKwBQ": { "defaultMessage": "eg. nsec1xyz" }, diff --git a/src/pages/widgets.tsx b/src/pages/widgets.tsx index 551c38a..2c4dd32 100644 --- a/src/pages/widgets.tsx +++ b/src/pages/widgets.tsx @@ -27,6 +27,7 @@ function ZapAlertConfiguration({ npub, baseUrl }: ZapAlertConfigurationProps) { const [textToSpeech, setTextToSpeech] = useState(false); const [voice, setVoice] = useState(null); const [minSatsForTextToSpeech, setMinSatsForTextToSpeech] = useState("21"); + const [volume, setVolume] = useState(1); // Google propietary voices are not available on OBS browser const voices = getVoices().filter(v => !v.name.includes("Google")); @@ -47,14 +48,15 @@ function ZapAlertConfiguration({ npub, baseUrl }: ZapAlertConfigurationProps) { const params = toTextToSpeechParams({ voiceURI: voice, minSats: voice ? Number(minSatsForTextToSpeech) : null, + volume, }); const queryParams = params.toString(); return queryParams.length > 0 ? `?${queryParams}` : ""; - }, [voice, minSatsForTextToSpeech]); + }, [voice, volume, minSatsForTextToSpeech]); function testVoice() { if (selectedVoice) { - speak(selectedVoice, testText); + speak(selectedVoice, testText, volume); } } @@ -103,6 +105,20 @@ function ZapAlertConfiguration({ npub, baseUrl }: ZapAlertConfigurationProps) { onChange={ev => setMinSatsForTextToSpeech(ev.target.value)} /> +
+ + setVolume(Number(ev.target.value))} + /> +