|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>MMS-TTS Speech Generator</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
max-width: 800px;
|
|
margin: 0 auto;
|
|
padding: 20px;
|
|
text-align: center;
|
|
}
|
|
textarea {
|
|
width: 100%;
|
|
height: 100px;
|
|
margin: 10px 0;
|
|
}
|
|
button {
|
|
padding: 10px 20px;
|
|
background-color: #4CAF50;
|
|
color: white;
|
|
border: none;
|
|
cursor: pointer;
|
|
}
|
|
button:hover {
|
|
background-color: #45a049;
|
|
}
|
|
.loading {
|
|
display: none;
|
|
font-size: 16px;
|
|
color: #333;
|
|
}
|
|
.spinner {
|
|
border: 4px solid #f3f3f3;
|
|
border-top: 4px solid #3498db;
|
|
border-radius: 50%;
|
|
width: 30px;
|
|
height: 30px;
|
|
animation: spin 1s linear infinite;
|
|
display: inline-block;
|
|
}
|
|
@keyframes spin {
|
|
0% { transform: rotate(0deg); }
|
|
100% { transform: rotate(360deg); }
|
|
}
|
|
.attribution {
|
|
font-size: 14px;
|
|
color: #555;
|
|
margin-top: 20px;
|
|
}
|
|
.error {
|
|
color: red;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>MMS-TTS Speech Generator</h1>
|
|
<p class="attribution">Model developed by Facebook AI</p>
|
|
<form method="POST" onsubmit="showLoading()">
|
|
<textarea name="text" placeholder="Enter text to convert to speech" required></textarea><br>
|
|
<button type="submit">Generate Speech</button>
|
|
</form>
|
|
<div id="loading" class="loading">
|
|
<span class="spinner"></span> Processing...
|
|
</div>
|
|
{% if audio_file %}
|
|
<audio controls>
|
|
<source src="{{ url_for('static', filename=audio_file) }}" type="audio/wav">
|
|
Your browser does not support the audio element.
|
|
</audio>
|
|
{% endif %}
|
|
{% if error %}
|
|
<p class="error">{{ error }}</p>
|
|
{% endif %}
|
|
<script>
|
|
function showLoading() {
|
|
document.getElementById("loading").style.display = "block";
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |