Skip to main content

Audio dataloaders

Project description

Audidata

Audidata is a toolkit that allows users to easily load audio datasets. Audidata supports music, audio, and speech datasets. Audidata also provides samplers, tokenizers, and transforms. Users can also create their own datasets, samplers, and transforms based on Audidata.

0. Installation

Method 1.

pip install audidata

Method 1. Download source code

git clone https://github.com/AudioFans/audidata
cd audidata
export PYTHONPATH=`pwd`  # Export environment path so that users can import audidata anywhere in the terminal.

1. Example

Users must download the dataset manually. The datsets should be structured described in dataset files. Here is an example of loading GTZAN dataset.

from audidata.datasets import GTZAN

root = "/datasets/gtzan"
dataset = GTZAN(root=root, split="train", test_fold=0, sr=16000)
print(dataset[0])

Output:

{'audio_path': '/datasets/gtzan/genres/blues/blues.00010.au', 
'audio': array([[ 0.11234417,  0.13617763,  0.10609552, ..., -0.06634186, -0.07007345, -0.07359146]], dtype=float32), 
'target': array([1., 0., 0., 0., 0., 0., 0., 0., 0., 0.], dtype=float32), 
'label': 'blues'}

For more examples please see audidata/examples. For example, users can run the following example script to concatenate multiple datasets:

python examples/test_concat_datasets.py

Output:

0 dict_keys(['dataset_name', 'audio_path', 'bass', 'drums', 'other', 'vocals', 'accompaniment', 'mixture'])
1 dict_keys(['dataset_name', 'audio_path', 'audio', 'target', 'label'])
2 dict_keys(['dataset_name', 'audio_path', 'bass', 'drums', 'other', 'vocals', 'accompaniment', 'mixture'])
3 dict_keys(['dataset_name', 'audio_path', 'audio', 'target', 'label'])

Repo structure

audidata
├── audidata
│   ├── collate
│   │   ├── base.py
│   │   └── ...
│   ├── datasets
│   │   ├── gtzan.py
│   │   └── ...
│   ├── io
│   │   ├── audio.py
│   │   └── ...
│   ├── samplers
│   │   ├── multi_datasets.py
│   │   └── ...
│   ├── tokenizers
│   │   ├── base.py
│   │   └── ...
│   ├── transforms
│   │   ├── midi.py
│   │   └── ...
│   └── utils.py
├── examples
│   ├── test_concat_datasets.py
│   └── ...
├── LICENSE
├── README.md
└── pyproject.toml

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

audidata-0.0.4.tar.gz (34.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

audidata-0.0.4-py3-none-any.whl (61.6 kB view details)

Uploaded Python 3

File details

Details for the file audidata-0.0.4.tar.gz.

File metadata

  • Download URL: audidata-0.0.4.tar.gz
  • Upload date:
  • Size: 34.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.19

File hashes

Hashes for audidata-0.0.4.tar.gz
Algorithm Hash digest
SHA256 b78cd7e9822135527a5c5168aceb9d2f926b75e25efbde2f3d01bb2c86a9abb1
MD5 5f366fb1b23aca10fef7a7c48efd98d6
BLAKE2b-256 405e2bf2afe8be883dd33f5ece9bc26ac8ab908a7c1b1985541864a3d028285d

See more details on using hashes here.

File details

Details for the file audidata-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: audidata-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 61.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.19

File hashes

Hashes for audidata-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9f54c580f639be0514a70d3da3a86a32ba633b1177a537c9350bb1fc2a40d6dc
MD5 45c836cf493babb72a38561abcfdc482
BLAKE2b-256 f3ae3a071266e80eb5f676b2f3e2cee18621559bbc8ef194a2592387c51f1195

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page