github / github/platform-samples
ai
- Langage dominant
- Shell
- Étoiles
- 2.2k
- Forks
- 1.9k
- Merge moyen
- 7 j 19 h
- PR mergées (30 j)
- 1
Description
from flask import Flask, render_template_string, request, send_file
import pyttsx3
import os
import uuid
import webbrowser
import threading
app = Flask(__name__)
HTML_FORM = """
Voice Service
🎤 Voice Service
Convert to Voice
"""
@app.route('/')
def home():
return render_template_string(HTML_FORM)
@app.route('/speak', methods=['POST'])
def speak():
text = request.form['text']
username = request.form['username']
engine = pyttsx3.init()
filename = f"{uuid.uuid4()}.mp3"
engine.save_to_file(f"{username} says: {text}", filename)
engine.runAndWait()
return send_file(filename, as_attachment=True)
def open_browser():
webbrowser.get("chrome").open("http://127.0.0.1:5000")
if __name__ == '__main__':
threading.Timer(1.5, open_browser).start()
app.run(debug=True)
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
The body contains an inline Flask application with the home and /speak routes, but names no repository file, test, or requested change. First clarify whether this code is intended as a new platform sample and what repository entry point should contain it; done should include an agreed sample scope and validation steps.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- flask, python
- Domaine
- backend, web-dev
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 15/100