sampling_rate()

audiofile.sampling_rate(file)[source]

Sampling rate of audio file.

Parameters

file (str) – file name of input audio file

Return type

int

Returns

sampling rate of audio file

Raises
  • FileNotFoundError – if mediainfo binary is needed, but cannot be found

  • RuntimeError – if file is missing, broken or format is not supported

Examples

>>> sampling_rate("stereo.wav")
8000