dcase_framework.files.AudioFile

class dcase_framework.files.AudioFile(*args, **kwargs)[source]

File class for audio files, valid file formats [wav, flac]

Constructor

Parameters:

fs : int

Target sampling frequency, if loaded audio does have different sampling frequency, audio will be re-sampled. Default value “44100”

mono : bool

Monophonic target, multi-channel audio will be down-mixed. Default value “True”

filename : str, optional

File path

logger : logger

Logger class instance, If none given logger instance will be created Default value “None”

__init__(*args, **kwargs)[source]

Constructor

Parameters:

fs : int

Target sampling frequency, if loaded audio does have different sampling frequency, audio will be re-sampled. Default value “44100”

mono : bool

Monophonic target, multi-channel audio will be down-mixed. Default value “True”

filename : str, optional

File path

logger : logger

Logger class instance, If none given logger instance will be created Default value “None”

Methods

__init__(\*args, \*\*kwargs) Constructor
detect_file_format(filename) Detect file format from extension
empty() Check if file is empty
exists() Checks that file exists
get_file_information() Get file information, filename
load(\*args, \*\*kwargs) Load file
save([filename, bitdepth]) Save audio

Attributes

valid_formats