github / github/platform-samples

ai

Đang mở
#806 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Shell
Star
2.2k
Fork
1.9k
Merge trung bình
7 ngày 19 giờ
Pull request đã merge (30 ngày)
1

Mô tả

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)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
flask, python
Lĩnh vực
backend, web-dev
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
15/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.