Audesc is an open-source library for descriptive Audio analysis, using Audesc you can get the following from the audio:
- sampling rate
- bit width
- duration
- number of samples
- number of channels
You can install audesc with PIP by using the following command:
pip install audesc
Clone the following command
git clone https://github.com/msalhab96/audesc
cd to the directory using the following command
cd audesc
Install the package using the following command
pip install .
- WAV
- FLAC
To describe WAV file
from audesc import WaveDescriber
file_path = 'my/path/to/file.wav'
aud_describer = WaveDescriber(file_path)
description = aud_describer.describe()
print(str(description))
print(description.sampling_rate)
print(description.channels_count)
print(description.duration)
print(description.bit_rate)
print(description.num_samples)
To describe FLAC file
from audesc import WaveDescriber
file_path = 'my/path/to/file.flac'
aud_describer = WaveDescriber(file_path)
description = aud_describer.describe()
print(str(description))
print(description.sampling_rate)
print(description.channels_count)
print(description.duration)
print(description.bit_rate)
print(description.num_samples)