Generate Audio with Python Script #208
delmenhorst
started this conversation in
General
Replies: 3 comments
-
import torch
import librosa as li
import soundfile as sf
torch.set_grad_enabled(False)
model = torch.jit.load("your_model.ts").eval()
x = li.load("some_audio.wav")[0]
x = torch.from_numpy(x).reshape(1,1,-1)
z = model.encode(x)
z[:, 0] += torch.linspace(-2,2,z.shape[-1])
y = model.decode(z).numpy().reshape(-1)
sf.write("model_output.wav", y, 44100) Hope this helps! |
Beta Was this translation helpful? Give feedback.
0 replies
-
thank you very much. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I was wondering if there is a code already for unconditional generation vs latent alteration which the above code is for... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
I trained several models with Rave1, does anyone have any good resources on how to generate audio files just with a Python script? My goal is to generate some WAV files with the prior model.
Has anyone done this? I know that there was some script around, but I didn't get through. Would anyone be willing to share their experience?
cheers. :)
Beta Was this translation helpful? Give feedback.
All reactions