ardaillon/FCN-f0

get_audio mono issue

Opened this issue · 0 comments

Just notice some distortion problem, it will make the sound weird.

I don't further experiment the performance will affect or not.

def get_audio(sndFile, model_input_size = 993, model_srate = 8000.):
    # read sound :
    from scipy.io import wavfile
    
    (sr, audio) = wavfile.read(sndFile)
    if len(audio.shape) == 2:
        audio = audio.mean(1)
        audio = audio.astype(np.float32, order='C') / 32768.    # avoid audio distortion

    sndDuration = len(audio)/sr
    print("duration of sound is "+str(sndDuration))