gradio/demo/reverse_audio.py

17 lines
277 B
Python
Raw Normal View History

2020-08-22 05:20:05 +08:00
# Demo: (Audio) -> (Audio)
2020-08-06 01:42:52 +08:00
import gradio as gr
import numpy as np
2020-08-28 23:56:03 +08:00
2020-08-06 01:42:52 +08:00
def reverse_audio(audio):
sr, data = audio
return (sr, np.flipud(data))
2020-08-28 23:56:03 +08:00
2020-11-11 22:15:53 +08:00
iface = gr.Interface(reverse_audio, "microphone", "audio")
2020-08-28 23:56:03 +08:00
2020-11-11 22:15:53 +08:00
iface.test_launch()
if __name__ == "__main__":
iface.launch()