def readwav(file):
 wav = _wave.open(file)
 rate = wav.getframerate()
 nchannels = wav.getnchannels()
 sampwidth = wav.getsampwidth()
 nframes = wav.getnframes()
 data = wav.readframes(nframes)
 wav.close()
 array = _wav2array(nchannels, sampwidth, data)
 return (rate, sampwidth, array)

def readwav ( file ) : wav = _wave . open ( file ) rate = wav . getframerate ( ) nchannels = wav . getnchannels ( ) sampwidth = wav . getsampwidth ( ) nframes = wav . getnframes ( ) data = wav . readframes ( nframes ) wav . close ( ) array = _wav2array ( nchannels , sampwidth , data ) return ( rate , sampwidth , array )
read a wav file .