channels()

audiofile.channels(file)[source]

Number of channels in audio file.

Parameters:

file (str | IOBase) – file name of input audio file or file-like object

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

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