|
import gradio as gr |
|
import subprocess |
|
import scripts.runSQ |
|
|
|
|
|
|
|
|
|
|
|
def setup(): |
|
r0 = subprocess.run(["pwd"], capture_output=True, text=True) |
|
print('PWD::', r0.stdout) |
|
r1 = subprocess.run(["wget", "https://github.com/google/REAPER/archive/refs/heads/master.zip"], capture_output=True, text=True) |
|
print(r1.stdout) |
|
subprocess.run(["unzip", "./master.zip"]) |
|
subprocess.run(["mv", "REAPER-master", "REAPER"]) |
|
subprocess.run(["rm", "./master.zip"]) |
|
os.chdir('./REAPER') |
|
subprocess.run(["mkdir", "build"]) |
|
os.chdir('./build') |
|
r2 = subprocess.run(["cmake", ".."], capture_output=True, text=True) |
|
print(r2.stdout) |
|
r3 = subprocess.run(["make"], capture_output=True, text=True) |
|
print(r3.stdout) |
|
|
|
os.chdir('../..') |
|
r9 = subprocess.run(["ls", "-la"], capture_output=True, text=True) |
|
print('LS::', r9.stdout) |
|
|
|
|
|
print('about to setup') |
|
setup() |
|
|
|
|
|
def f1(voices, sent): |
|
one_tts = scripts.runSQ.run(sentence,voices) |
|
return (one_tts) |
|
|
|
|
|
|
|
|
|
|
|
bl = gr.Blocks() |
|
with bl: |
|
|
|
|
|
temp_sentences = ['Litlaus græn hugmynd?','Var það ekki nóg?', 'Ef svo er hvað heita þau þá?','Eru maríuhænur á Íslandi?'] |
|
|
|
voices = ['Alfur','Dora'] |
|
|
|
|
|
|
|
|
|
with gr.Row(): |
|
with gr.column(scale=4): |
|
voiceselect = gr.checkboxgroup(voices, label="TTS voice",value='Alfur') |
|
temp_sentmenu = gr.dropdown(temp_sentences, label="Sentence") |
|
with gr.column(scale=1): |
|
temp_button = gr.Button(value="A button") |
|
|
|
|
|
tts_output = gr.Audio(interactive=False) |
|
|
|
|
|
|
|
tmp_button.click(f1,[voiceselect,temp_sentmenu],[tts_output]) |
|
|
|
|
|
if __name__ == "__main__": |
|
bl.launch() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|