(vid_path, sr, mode='train')
load_wav() is really slow on this version of librosa.
    load_wav_fast() is faster but we are not ensuring a consistent sampling rate
load_wav() is really slow on this version of librosa.
    load_wav_fast() is faster but we are not ensuring a consistent sampling rate
load_wav () is really slow on this version of librosa . load_wav_fast () is faster but we are not ensuring a consistent sampling rate
def load_wav_fast(vid_path, sr, mode='train'):
    """load_wav() is really slow on this version of librosa.
    load_wav_fast() is faster but we are not ensuring a consistent sampling rate"""
    wav, sr_ret = sf.read(vid_path)

    if mode == 'train':
        extended_wav = np.append(wav, wav)
        if np.random.random() < 0.3:
            extended_wav = extended_wav[::-1]
        return extended_wav
    else:
        extended_wav = np.append(wav, wav[::-1])
        return extended_wav
def load_wav_fast ( vid_path , sr , mode = 'train' ) : wav , sr_ret = sf . read ( vid_path ) if mode == 'train' : extended_wav = np . append ( wav , wav ) if np . random . random ( ) < 0.3 : extended_wav = extended_wav [ : : - 1 ] return extended_wav else : extended_wav = np . append ( wav , wav [ : : - 1 ] ) return extended_wav