samples()

audiofile.samples(file)[source]

Number of samples in audio file.

Audio files that are not WAV, FLAC, MP3, or OGG are first converted to WAV, before counting the samples.

Parameters

file (str) – file name of input audio file

Return type

int

Returns

number of samples in audio file

Raises

Examples

>>> samples("stereo.wav")
12000