File size: 1,039 Bytes
3998283
cbb96d8
64a4bbe
3998283
898ed8c
2a0225b
c2f1749
1f1c84d
b49f5d3
 
5542a92
b49f5d3
 
 
2a0225b
 
3998283
e66b829
 
 
3998283
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from audio_style_transfer.models import timedomain
import librosa

def audioStyleTransfer(content,style):
    print (style,content)
    output = "/tmp/outputfile.wav"
    sr = librosa.get_samplerate(content)
    timedomain.run( style_fname=style, content_fname=content ,output_fname=output, n_fft=4096,
               n_filters=4096,
               hop_length=256,
               alpha=0.05,
               k_w=4,          # 1 to 3. Lower is better quality but is slower.
               sr=sr)
    print ("output is " ,output)
    return  output

iface = gr.Interface(fn=audioStyleTransfer, title="Time Domain Audio Style transfer",
                    description="Forked from https://github.com/pkmital/time-domain-neural-audio-style-transfer Built to style transfer to audio using style audio.\
       it seems to work best for shorter clips", inputs=[gr.Audio(source="upload",type="filepath",label="Content"),gr.Audio(source="upload",type="filepath",label="Style")], outputs=gr.Audio(label="Output"))
iface.launch()