Spaces:
Runtime error
Runtime error
MZhao-LEGION
commited on
Commit
•
63bb040
1
Parent(s):
83e153f
Do not play audio when loading
Browse files- app.py +2 -2
- presets.py +1 -1
app.py
CHANGED
@@ -14,12 +14,12 @@ with gr.Blocks(css=customCSS) as demo:
|
|
14 |
with gr.Tab("Mimic", elem_id="tab-mimic"):
|
15 |
gr.Textbox(lines=1, placeholder="Coming Soon...", label="Choose sound to mimic:", elem_classes="wonder-card input_text", elem_id="mimic_input", interactive=False)
|
16 |
mimic_button = gr.Button("Mimic!", elem_id="mimic_button", elem_classes="main-button wonder-card")
|
17 |
-
audio_output = gr.Audio(label="输出音频", show_label=False, autoplay=
|
18 |
|
19 |
demo.load(
|
20 |
init_fn,
|
21 |
inputs=[],
|
22 |
-
outputs=[
|
23 |
)
|
24 |
speak_input.submit(submit_lock_fn, show_progress=False).then(
|
25 |
speak_fn,
|
|
|
14 |
with gr.Tab("Mimic", elem_id="tab-mimic"):
|
15 |
gr.Textbox(lines=1, placeholder="Coming Soon...", label="Choose sound to mimic:", elem_classes="wonder-card input_text", elem_id="mimic_input", interactive=False)
|
16 |
mimic_button = gr.Button("Mimic!", elem_id="mimic_button", elem_classes="main-button wonder-card")
|
17 |
+
audio_output = gr.Audio(label="输出音频", show_label=False, autoplay=False, elem_id="audio_output", elem_classes="wonder-card")
|
18 |
|
19 |
demo.load(
|
20 |
init_fn,
|
21 |
inputs=[],
|
22 |
+
outputs=[character_area]
|
23 |
)
|
24 |
speak_input.submit(submit_lock_fn, show_progress=False).then(
|
25 |
speak_fn,
|
presets.py
CHANGED
@@ -133,7 +133,7 @@ def init_fn():
|
|
133 |
index = random.randint(1,7)
|
134 |
welcome_text = get_sentence("Welcome", index)
|
135 |
|
136 |
-
return gr.update(value=f"./assets/audios/Welcome{index}.wav", autoplay=False),
|
137 |
|
138 |
def get_sentence(category, index=-1):
|
139 |
if index == -1:
|
|
|
133 |
index = random.randint(1,7)
|
134 |
welcome_text = get_sentence("Welcome", index)
|
135 |
|
136 |
+
return get_character_html(welcome_text) #gr.update(value=f"./assets/audios/Welcome{index}.wav", autoplay=False),
|
137 |
|
138 |
def get_sentence(category, index=-1):
|
139 |
if index == -1:
|