Package: audiomate
AUDIOMATEAudiomate is a library for easy access to audio datasets.
It provides the datastructures for accessing/loading different datasets in a generic way.
This should ease the use of audio datasets for example for machine learning tasks.importaudiomatefromaudiomate.corpusimportio# Download a datasetesc_downloader=io.ESC50Downloader()esc_downloader.download('/local/path')# Load and work with the datasetesc50=audiomate.Corpus.load('/local/path',reader='esc-50')# e.g. Read the audio signal and the label of specific sample/utteranceutterance=esc50.utterances['1-100032-A-0']samples=utterance.read_samples()label_list=utterance.label_lists[audiomate.corpus.LL_SOUND_CLASS]forlabelinlabel_list:print(label.start,label.value)Furthermore it provides tools for interacting with datasets
(validation, splitting, subsets, merge, filter), extracting features,
feeding samples for training ML models and more.DocumentationExamplesChangelogCurrently supported datasets:Acoustic Event DatasetAudioMNISTMozilla Common VoiceESC-50Fluent Speech CommandsFree Spoken Digit DatasetGerman Distant Speech CorpusGoogle Speech CommandsGTZANLibriSpeechM-AILABS Speech DatasetMUSANLITIS Rouen Audio scene datasetSpoken Wikipedia CorporaTatoebaTIMITUrbansound8kVoxforgeCurrently supported formats:KaldiMozilla DeepSpeechWav2LetterNVIDIA JasperCustom FormatsInstallationpipinstallaudiomateInstall the latest development version:pipinstallgit+https://github.com/ynop/audiomate.gitDependenciessoxFor parts of the functionality (e.g. audio format conversion)soxis used. In order to use it, you have to install sox.# macosbrewinstallsox# with support for specific formatsbrewinstallsox--with-lame--with-flac--with-libvorbis# linuxapt-getinstallsox# anaconda for macOS/windows/linux:condainstall-cconda-forgesoxDevelopmentPrerequisitesA supported version of Python > 3.5It's recommended to use a virtual environment when developing audiomate.
To create one, execute the following command in the project's root directory:python -m venv .To install audiomate and all it's dependencies, execute:pip install -e .Running the test suitepip install -e .[dev]
pytestWith PyCharm you might have to change the default test runner. Otherwise, it might only suggest to use nose. To do so, go to File > Settings > Tools > Python Integrated Tools (on the Mac it's PyCharm > Preferences > Settings > Tools > Python Integrated Tools) and change the test runner to py.test.BenchmarksIn order to check the runtime of specific parts,pytest-benchmarkis used. Benchmarks are normal test functions, but call the benchmark fixture for the code under test.To run benchmarks:# Run all
pytest bench

# Specific benchmark
pytest bench/corpus/test_merge_corpus.pyTo compare between different runs:pytest-benchmark compareEditing the DocumentationThe documentation is written inreStructuredTextand transformed into various output formats with the help ofSphinx.Syntax reference reStructuredTextSphinx-specific additions to reStructuredTextTo generate the documentation, execute:pip install -e .[dev]
cd docs
make htmlThe generated files are written todocs/_build/html.VersionsVersions is handled usingbump2version. To bump the version:bump2version [major,minor,patch,release,num]In order to directly go to a final relase version (skip .dev/.rc/...):bump2version [major,minor,patch] --new-version x.x.xReleaseCommands to create a new release on pypi.rm -rf build
rm -rf dist

python setup.py sdist
python setup.py bdist_wheel
twine upload dist/*