File size: 852 Bytes
1a7d583
85d3b29
 
1a7d583
 
 
 
85d3b29
 
 
 
 
 
 
 
1a7d583
 
 
 
 
 
 
85d3b29
 
 
1a7d583
85d3b29
 
1a7d583
85d3b29
1a7d583
85d3b29
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
import os, sys
import gradio as gr

now_dir = os.getcwd()
sys.path.append(now_dir)

from core import run_audio_analyzer_script
from assets.i18n.i18n import I18nAuto

i18n = I18nAuto()


def analyzer():
    with gr.Column():
        audio_input = gr.Audio(type="filepath")
        output_info = gr.Textbox(
            label=i18n("Output Information"),
            info=i18n("The output information will be displayed here."),
            value="",
            max_lines=8,
            interactive=False,
        )
        get_info_button = gr.Button(
            value=i18n("Get information about the audio"), variant="primary"
        )
        image_output = gr.Image(type="filepath", interactive=False)

    get_info_button.click(
        fn=run_audio_analyzer_script,
        inputs=[audio_input],
        outputs=[output_info, image_output],
    )