channels()

audiofile.channels(file)[source]

Number of channels in audio file.

Parameters

file (str) – file name of input audio file

Return type

int

Returns

number of channels in 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

>>> channels("stereo.wav")
2