File size: 445 Bytes
4778007
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# server.py
from flask import Flask, render_template
import subprocess

app = Flask(__name__)

@app.route('/')
def index():
    return render_template('index.html')

@app.route('/start-recording', methods=['POST'])
def start_recording():
    # Execute the Python script (app.py) with Gradio when the button is pressed
    subprocess.Popen(["python", "app.py"])
    return "Recording started."

if __name__ == '__main__':
    app.run(debug=True)