#!/bin/bash
echo "=== TTS Proxy Test ==="
curl -s -w '\nHTTP: %{http_code} Size: %{size_download}\n' \
  -o /tmp/proxy_verify.wav \
  http://localhost:9090/api/proxy/tts \
  -H 'Content-Type: application/json' \
  -d '{"input":"This is a verification test.","voice":"Vivian","language":"en","speed":1.0}'

echo "=== File check ==="
file /tmp/proxy_verify.wav 2>/dev/null
ls -la /tmp/proxy_verify.wav 2>/dev/null

echo "=== New speakText in HTML ==="
curl -s http://localhost:9090/ | grep -c 'Generating audio'
curl -s http://localhost:9090/ | grep -c 'TTS not ready'
curl -s http://localhost:9090/ | grep -c 'targetDiv'
