Skip to content

How to reconstruct audio directly from codes #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
amuvarma13 opened this issue Oct 18, 2024 · 0 comments
Open

How to reconstruct audio directly from codes #25

amuvarma13 opened this issue Oct 18, 2024 · 0 comments

Comments

@amuvarma13
Copy link

I use this function to get the codes.

with torch.no_grad():
    source_audio = librosa.load("/content/FAcodec/spks.wav", sr=24000)[0]
    source_audio = torch.tensor(source_audio).unsqueeze(0).float().to(device)
    z = model.encoder(source_audio[None, ...].to(device).float())
    z, quantized, _, _, timbre, codes = model.quantizer(z, source_audio[None, ...].to(device).float(), return_codes=True)

However, I am struggling to understand how to recover the audio from these codes and the timbre vector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant