Skip to content
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

When sampling speaker, it gives me a weird version of my sample audio #837

Open
sfgij opened this issue Dec 8, 2024 · 0 comments
Open

Comments

@sfgij
Copy link

sfgij commented Dec 8, 2024

def GenerateAudio(Voice, Text):
    voiceDir = f"./NexusVoice/Voices/{Voice}"

    if os.path.realpath(voiceDir):
        AudioPath = os.path.join(voiceDir,"audio.wav")
        if not os.path.realpath(AudioPath):
            return

        audioSample = chat.sample_audio_speaker(wave_read(AudioPath))

        InferParams = chat.InferCodeParams(
            top_P = 0.7,
            top_K = 20,

            spk_smp= audioSample,
            txt_smp = open(os.path.join(voiceDir,"Transcription.txt")).read(),
        )
        RefineParams = chat.RefineTextParams(
            top_P = 0.7,
            top_K = 20,
        )
        print(Text)
        AudioFile = chat.infer(
            Text,
            params_infer_code = InferParams,
            params_refine_text = RefineParams,
        )

        torchaudio.save("word_level_output.wav", torch.from_numpy(AudioFile[0]).unsqueeze(0), 24000)

above is the code I am using for it please ask if you want any more details

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