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

why my result used your SEGAN+ generator weights can't be a human voice? #22

Open
LittleFlyingSheep opened this issue Nov 21, 2019 · 4 comments

Comments

@LittleFlyingSheep
Copy link

Hello,I used your generator to clean the test_noisy.However,the result is so terrible that it can't be sound like a human voice,and the time of each result was different from the test data.Could you please help me repair it?

@yellowyi9527
Copy link

yellowyi9527 commented Aug 19, 2020

I meet same problem and the code have too many bug.

@LittleFlyingSheep
Copy link
Author

I meet same problem and the code have too many bug.

Well, I solve this problem. Check the code which trun numpy data to wav. The sample rate of test is 48kHz not 16kHz.
Best wishes.

@yellowyi9527
Copy link

Thanks for your help with the problem that has troubled me for several days. Thank you very much. @LittleFlyingSheep

@unanan
Copy link

unanan commented Jun 15, 2021

about the rate:
modify:
https://github.com/santi-pdp/segan_pytorch/blob/master/clean.py#L60-L78
to:

if not opts.h5:
            tbname = os.path.basename(twav)
            rate, wav = wavfile.read(twav)
            wav = normalize_wave_minmax(wav)
        else:
            tbname = 'tfile_{}.wav'.format(t_i)
            wav = twav
            twav = tbname
            rate = 16000
        wav = pre_emphasize(wav, args.preemph)
        pwav = torch.FloatTensor(wav).view(1,1,-1)
        if opts.cuda:
            pwav = pwav.cuda()
        g_wav, g_c = segan.generate(pwav)
        out_path = os.path.join(opts.synthesis_path,
                                tbname) 
        if opts.soundfile:
            sf.write(out_path, g_wav, rate)
        else:
            wavfile.write(out_path, rate, g_wav)

Or use ffmpeg to convert your wav file:

ffmpeg -i [MP3/Wav file] -acodec pcm_s16le -ac 1 -ar 16000 [Output wav file]

refer to:
https://stackoverflow.com/a/19073622

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

3 participants