Return the sample rate (in samples/sec) and data from a WAV file

Parameters :

file : file

Input wav file.

Returns :

rate : int

Sample rate of wav file

data : numpy array

Data read from wav file


  • The file can be an open file or a filename.
  • The returned sample rate is a Python integer
  • The data is returned as a numpy array with a data-type determined from the file.

Previous topic

Next topic