#!/bin/bash API_URL="https://ebitlogix-parler-tts-api.hf.space" OUTPUT_DIR="tts_output" mkdir -p "$OUTPUT_DIR" echo "======================================================================" echo "TTS API Test Suite - Urdu Text Generation" echo "======================================================================" echo "" # Health check echo "Testing API Health Check..." response=$(curl -s "$API_URL/") if echo "$response" | grep -q "ok"; then echo "✅ API is running" echo " Response: $response" else echo "❌ API is not responding" exit 1 fi echo "" echo "======================================================================" echo "Testing TTS Generation with Urdu Text" echo "======================================================================" echo "" # Test cases: text|speaker|description declare -a TESTS=( "سلام دنیا|Divya|Hello World" "مرحبا بك في تطبيق تحويل النص إلى كلام|Rani|Welcome to TTS App" "یہ ایک اردو متن ہے جو آواز میں تبدیل ہوگا|Rohit|This is Urdu text" "کتاب پڑھنا میرا پسندیدہ کام ہے|Aman|Reading books" "خوشامدید، یہ ایک خوبصورت دن ہے|Generic Female|Beautiful day" "ہمیں اپنے لیے بہتر مستقبل بنانی ہے|Generic Male|Build future" ) successful=0 failed=0 count=0 for test in "${TESTS[@]}"; do IFS='|' read -r text speaker description <<< "$test" ((count++)) echo "[$count/${#TESTS[@]}] Testing: $description" echo " Text: $text" echo " Speaker: $speaker" # Create JSON payload json_payload=$(cat <