maad.util.audio_header
- maad.util.audio_header(path_audio)[source]
Get audio header information from WAVE file. Header information includes, sample rate, bit depth, number of channels, number of samples, file size and duration.
- Parameters:
- path_audiostr
Location of audio file.
- Returns:
- metadatadictionary
header information.
Examples
>>> from maad import util >>> dic_metadata = util.audio_header('../data/spinetail.wav') >>> print(dic_metadata) {'path_audio': '../data/spinetail.wav', 'fname': 'spinetail.wav', 'sample_rate': 44100, 'channels': 1, 'bits': 16, 'samples': 861799, 'fsize': 1723642, 'length': 19.541927437641725}