diff --git a/src/dashboard/templates/voice_button.html b/src/dashboard/templates/voice_button.html
index 5f79247b..ac088f33 100644
--- a/src/dashboard/templates/voice_button.html
+++ b/src/dashboard/templates/voice_button.html
@@ -30,6 +30,27 @@
+
+
// VOICE CUSTOMIZATION
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Try saying:
@@ -87,6 +108,38 @@ function startListening() {
function stopListening() {
if (recognition && isListening) { recognition.stop(); }
}
+function updateRateLabel(val) { document.getElementById('rate-val').textContent = val; }
+function updateVolumeLabel(val) { document.getElementById('volume-val').textContent = val; }
+
+async function updateVoiceSettings() {
+ const voice_id = document.getElementById('voice-select').value;
+ const rate = document.getElementById('rate-slider').value;
+ const volume = document.getElementById('volume-slider').value;
+
+ try {
+ await fetch('/voice/settings', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+ body: 'voice_id=' + encodeURIComponent(voice_id) + '&rate=' + rate + '&volume=' + volume
+ });
+ } catch (e) {
+ console.error('Failed to update voice settings:', e);
+ }
+}
+
+async function testVoice() {
+ const text = "Hello, I am Timmy. How can I help you today?";
+ try {
+ await fetch('/voice/tts/speak', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+ body: 'text=' + encodeURIComponent(text)
+ });
+ } catch (e) {
+ console.error('Failed to test voice:', e);
+ }
+}
+
function resetButton() {
document.getElementById('voice-status').textContent = 'Tap and hold to speak';
document.getElementById('voice-btn').classList.remove('listening');