def wavread(filename):
 if (os.path.isfile(filename) == False):
  raise ValueError('Input file is wrong')
 (fs, x) = read(filename)
 if (len(x.shape) != 1):
  raise ValueError('Audio file should be mono')
 if (fs != 44100):
  raise ValueError('Sampling rate of input sound should be 44100')
 x = (np.float32(x) / norm_fact[x.dtype.name])
 return (fs, x)

def wavread ( filename ) : if ( os . path . isfile ( filename ) == False ) : raise ValueError ( 'Input file is wrong' ) ( fs , x ) = read ( filename ) if ( len ( x . shape ) != 1 ) : raise ValueError ( 'Audio file should be mono' ) if ( fs != 44100 ) : raise ValueError ( 'Sampling rate of input sound should be 44100' ) x = ( np . float32 ( x ) / norm_fact [ x . dtype . name ] ) return ( fs , x )
read a sound file and convert it to a normalized floating point array filename: name of file to read returns fs: sampling rate of file .