dlaiu
try again
a2df844
raw
history blame
638 Bytes
import gradio as gr
import parselmouth
from parselmouth.praat import call
# def greet(name):
# return "Hello " + name + "!!"
# demo = gr.Interface(fn=greet, inputs="text", outputs="text")
# demo.launch()
def get_pitch(audio_file):
sound = parselmouth.Sound(audio_file)
pitch = call(sound, "To Pitch", 0.0, 75, 500) # Make sure these settings are appropriate for your needs
pitch_values = pitch.selected_array['frequency']
return "Pitch frequencies: " + str(pitch_values) # Printing is not suitable here, return the string instead
demo = gr.Interface(fn=get_pitch, inputs="audio", outputs="text")
demo.launch()