github / github/platform-samples
ai
- Dominant language
- Shell
- Stars
- 2.2k
- Forks
- 1.9k
- Avg merge
- 7d 19h
- Merged PRs (30d)
- 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)
Contributor guide
Research direction
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.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, python
- Domain
- backend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100