undefined - Initial Deployment
Browse filesFiles changed (2)
- README.md+7-5
- index.html+429-19
12345678910---title: Text Kimoemoji: 🐢colorFrom: yellowcolorTo: redsdk: staticpinned: false---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference123456789101112---title: text-kimoemoji: 🐳colorFrom: graycolorTo: greensdk: staticpinned: falsetags:- deepsite---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
12345678910111213141516171819<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>My static Space</title><link rel="stylesheet" href="style.css" /></head><body><div class="card"><h1>Welcome to your static Space!</h1><p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p><p>Also don't forget to check the<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.</p></div></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>American English Text-to-Speech Converter</title><script src="https://cdn.tailwindcss.com"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"><style>@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');body {font-family: 'Poppins', sans-serif;background-color: #f8fafc;}.gradient-bg {background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);}.wave-animation {animation: wave 2s ease-in-out infinite;}@keyframes wave {0%, 100% {transform: translateY(0);}50% {transform: translateY(-10px);}}.speech-controls {transition: all 0.3s ease;}.speech-controls:hover {transform: scale(1.05);}#textInput {min-height: 150px;resize: none;}/* Custom range slider */input[type="range"] {-webkit-appearance: none;height: 8px;background: #e2e8f0;border-radius: 5px;background-image: linear-gradient(#3b82f6, #3b82f6);background-size: 0% 100%;background-repeat: no-repeat;}input[type="range"]::-webkit-slider-thumb {-webkit-appearance: none;height: 20px;width: 20px;border-radius: 50%;background: #3b82f6;cursor: pointer;box-shadow: 0 0 2px 0 #555;transition: all 0.3s ease;}input[type="range"]::-webkit-slider-thumb:hover {transform: scale(1.2);background: #2563eb;}/* Animation for speaking state */@keyframes pulse {0%, 100% {transform: scale(1);box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);}50% {transform: scale(1.05);box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);}}.speaking {animation: pulse 1.5s infinite;}</style></head><body class="min-h-screen flex flex-col"><header class="gradient-bg text-white py-6 shadow-lg"><div class="container mx-auto px-4"><div class="flex items-center justify-between"><div class="flex items-center space-x-3"><i class="fas fa-language text-3xl wave-animation"></i><h1 class="text-2xl md:text-3xl font-bold">American Speech Converter</h1></div><div class="hidden md:flex items-center space-x-2"><span class="text-sm bg-white bg-opacity-20 px-3 py-1 rounded-full">New</span><span class="text-sm">v1.0</span></div></div></div></header><main class="flex-grow container mx-auto px-4 py-8"><div class="max-w-4xl mx-auto"><div class="bg-white rounded-xl shadow-lg overflow-hidden"><!-- Controls Section --><div class="bg-gray-50 px-6 py-4 border-b"><div class="flex flex-wrap items-center justify-between gap-4"><div class="flex items-center space-x-4"><button id="speakBtn" class="bg-blue-500 hover:bg-blue-600 text-white px-6 py-2 rounded-lg font-medium flex items-center space-x-2 speech-controls"><i class="fas fa-play"></i><span>Speak</span></button><button id="stopBtn" class="bg-gray-200 hover:bg-gray-300 text-gray-800 px-6 py-2 rounded-lg font-medium flex items-center space-x-2 speech-controls"><i class="fas fa-stop"></i><span>Stop</span></button></div><div class="flex items-center space-x-4"><button id="downloadBtn" class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-lg font-medium flex items-center space-x-2 speech-controls"><i class="fas fa-download"></i><span class="hidden md:inline">Download</span></button></div></div><div class="mt-4 grid grid-cols-1 md:grid-cols-2 gap-4"><div class="space-y-2"><label for="repeatCount" class="block text-sm font-medium text-gray-700">Repeat Sentences: <span id="repeatValue" class="font-bold">1</span> times</label><input type="range" id="repeatCount" min="1" max="5" value="1" class="w-full"></div><div class="space-y-2"><label for="pauseDuration" class="block text-sm font-medium text-gray-700">Pause Between Sentences: <span id="pauseValue" class="font-bold">1</span> seconds</label><input type="range" id="pauseDuration" min="1" max="4" value="1" class="w-full"></div></div></div><!-- Text Input Section --><div class="p-6"><div class="mb-4"><label for="textInput" class="block text-sm font-medium text-gray-700 mb-2">Enter your text to convert to American English speech:</label><textarea id="textInput" class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition duration-200" placeholder="Type or paste your text here..."></textarea></div><div class="flex flex-wrap items-center justify-between gap-4"><div class="flex items-center space-x-2"><button id="clearBtn" class="text-gray-600 hover:text-gray-800 flex items-center space-x-1"><i class="fas fa-trash-alt"></i><span>Clear</span></button></div><div class="flex items-center space-x-2 text-sm text-gray-500"><i class="fas fa-info-circle"></i><span>Character count: <span id="charCount">0</span></span></div></div></div></div><!-- Voice Preview Section --><div class="mt-8 bg-white rounded-xl shadow-lg overflow-hidden"><div class="px-6 py-4 border-b bg-gray-50"><h2 class="text-lg font-medium text-gray-800">Voice Preview</h2></div><div class="p-6"><div class="flex items-center justify-between mb-4"><div class="flex items-center space-x-3"><div id="voiceIcon" class="bg-blue-100 text-blue-600 p-3 rounded-full"><i class="fas fa-user-tie text-xl"></i></div><div><h3 class="font-medium">American English</h3><p class="text-sm text-gray-500">Standard US accent</p></div></div><button id="testVoiceBtn" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg text-sm flex items-center space-x-2"><i class="fas fa-volume-up"></i><span>Test Voice</span></button></div><div class="bg-blue-50 border border-blue-100 rounded-lg p-4"><p class="text-blue-800 text-sm">"Hello, welcome to the American English text-to-speech converter. This is how your text will sound."</p></div></div></div></div></main><footer class="bg-gray-100 py-6 border-t"><div class="container mx-auto px-4 text-center text-gray-600 text-sm"><p>© 2023 American Speech Converter. All rights reserved.</p></div></footer><script>document.addEventListener('DOMContentLoaded', function() {// DOM Elementsconst textInput = document.getElementById('textInput');const speakBtn = document.getElementById('speakBtn');const stopBtn = document.getElementById('stopBtn');const downloadBtn = document.getElementById('downloadBtn');const clearBtn = document.getElementById('clearBtn');const testVoiceBtn = document.getElementById('testVoiceBtn');const repeatCount = document.getElementById('repeatCount');const pauseDuration = document.getElementById('pauseDuration');const repeatValue = document.getElementById('repeatValue');const pauseValue = document.getElementById('pauseValue');const charCount = document.getElementById('charCount');const voiceIcon = document.getElementById('voiceIcon');// Speech Synthesisconst synth = window.speechSynthesis;let utterance = null;let speechQueue = [];let isSpeaking = false;let audioChunks = [];let mediaRecorder;let audioContext;// Update character counttextInput.addEventListener('input', function() {charCount.textContent = this.value.length;});// Update slider valuesrepeatCount.addEventListener('input', function() {repeatValue.textContent = this.value;});pauseDuration.addEventListener('input', function() {pauseValue.textContent = this.value;});// Clear textclearBtn.addEventListener('click', function() {textInput.value = '';charCount.textContent = '0';});// Test voicetestVoiceBtn.addEventListener('click', function() {if (isSpeaking) {synth.cancel();}const testText = "Hello, welcome to the American English text-to-speech converter. This is how your text will sound.";speakText(testText, 1, 1, false);});// Speak buttonspeakBtn.addEventListener('click', function() {if (textInput.value.trim() === '') {showAlert('Please enter some text to convert to speech.', 'error');return;}if (isSpeaking) {synth.cancel();isSpeaking = false;updateSpeakingState(false);return;}const text = textInput.value;const repeat = parseInt(repeatCount.value);const pause = parseInt(pauseDuration.value);speakText(text, repeat, pause, true);});// Stop buttonstopBtn.addEventListener('click', function() {synth.cancel();isSpeaking = false;updateSpeakingState(false);speechQueue = [];});// Download buttondownloadBtn.addEventListener('click', function() {if (textInput.value.trim() === '') {showAlert('Please enter some text before downloading.', 'error');return;}showAlert('Audio download feature requires server-side processing in a real application. This is a frontend demo.', 'info');// In a real application, you would:// 1. Send the text to a server// 2. Generate audio file using a TTS service// 3. Return the audio file for download// This is just a simulation for the demo// const link = document.createElement('a');// link.href = '#'; // Would be the audio file URL in a real app// link.download = 'american-speech.mp3';// link.click();});// Function to speak textfunction speakText(text, repeat, pause, updateState) {if (synth.speaking) {synth.cancel();}// Split text into sentencesconst sentences = text.split(/(?<=[.!?])\s+/);speechQueue = [];// Create utterances for each sentence with repeatssentences.forEach(sentence => {if (sentence.trim() === '') return;for (let i = 0; i < repeat; i++) {const utterance = new SpeechSynthesisUtterance(sentence);utterance.lang = 'en-US';utterance.rate = 1.0;utterance.pitch = 1.0;utterance.volume = 1.0;speechQueue.push(utterance);// Add pause utterances between repeats (except the last one)if (i < repeat - 1) {const pauseUtterance = new SpeechSynthesisUtterance('');pauseUtterance.lang = 'en-US';pauseUtterance.rate = 0.1; // Very slow to simulate pausespeechQueue.push(pauseUtterance);}}// Add pause between sentences (except the last one)if (sentences.indexOf(sentence) < sentences.length - 1) {const pauseUtterance = new SpeechSynthesisUtterance('');pauseUtterance.lang = 'en-US';pauseUtterance.rate = 0.1; // Very slow to simulate pausespeechQueue.push(pauseUtterance);}});// Start speakingisSpeaking = true;if (updateState) {updateSpeakingState(true);}speakNextInQueue();}// Function to speak next item in queuefunction speakNextInQueue() {if (speechQueue.length === 0) {isSpeaking = false;updateSpeakingState(false);return;}const utterance = speechQueue.shift();// Check if this is a pause utteranceif (utterance.text === '') {// This is a pause - wait for the specified durationsetTimeout(() => {speakNextInQueue();}, parseInt(pauseDuration.value) * 1000);return;}utterance.onend = function() {speakNextInQueue();};synth.speak(utterance);}// Update speaking state UIfunction updateSpeakingState(speaking) {if (speaking) {speakBtn.innerHTML = '<i class="fas fa-pause"></i><span>Pause</span>';speakBtn.classList.remove('bg-blue-500', 'hover:bg-blue-600');speakBtn.classList.add('bg-yellow-500', 'hover:bg-yellow-600');voiceIcon.classList.add('speaking');} else {speakBtn.innerHTML = '<i class="fas fa-play"></i><span>Speak</span>';speakBtn.classList.remove('bg-yellow-500', 'hover:bg-yellow-600');speakBtn.classList.add('bg-blue-500', 'hover:bg-blue-600');voiceIcon.classList.remove('speaking');}}// Show alert messagefunction showAlert(message, type) {const alert = document.createElement('div');alert.className = `fixed top-4 right-4 px-6 py-3 rounded-lg shadow-lg text-white font-medium flex items-center space-x-2 z-50 ${type === 'error' ? 'bg-red-500' :type === 'success' ? 'bg-green-500' :'bg-blue-500'}`;alert.innerHTML = `<i class="fas ${type === 'error' ? 'fa-exclamation-circle' : type === 'success' ? 'fa-check-circle' : 'fa-info-circle'}"></i><span>${message}</span>`;document.body.appendChild(alert);setTimeout(() => {alert.style.opacity = '0';alert.style.transition = 'opacity 0.5s ease';setTimeout(() => {document.body.removeChild(alert);}, 500);}, 3000);}// InitializecharCount.textContent = textInput.value.length;});</script><p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Karimen/text-kimo" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body></html>
README.md+7-5
index.html+429-19