dcase_util.utils.FileFormat.detect

classmethod FileFormat.detect(filename, use_content_for_unknown=True)[source]

Detect file format. First the file extension is used, if the format is not recognized based on filename alone then content is checked given that file exists.

Parameters
filenamestr

Path to the file

use_content_for_unknownbool

Use file content to detect the file format if file exists. Default value True

Returns
str

File format label