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
- Returns
number of samples in audio file
- Raises
FileNotFoundError – if ffmpeg binary is needed, but cannot be found
RuntimeError – if
file
is missing, broken or format is not supported
Examples
>>> samples("stereo.wav") 12000