File size: 2,006 Bytes
f0fa26d
51c86c4
f0fa26d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a2b291c
f0fa26d
 
 
 
 
 
 
 
 
 
 
 
e8d7f64
f0fa26d
 
 
 
 
7891ce0
 
 
 
f0fa26d
 
 
 
 
 
 
94e087c
f0fa26d
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import gradio as gr
import subprocess, os
import scripts.runSQ


#https://huggingface.co/spaces/clr/prosalign/blob/main/app.py


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(sent,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','Dilja']
    # currently i only get json speech marks for those two. 
    # supposedly they also provided for Karl, Dora, but i dont even get their wavs
    # i get everyone elses wavs tho
    
    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)
    
    
    
    temp_button.click(f1,[voiceselect,temp_sentmenu],[tts_output])
    
    
if __name__ == "__main__":
    bl.launch()