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.5.tar.gz (33.5 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.5-py3-none-any.whl (61.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for audidata-0.0.5.tar.gz
Algorithm Hash digest
SHA256 9edfbd8bbbb1977a4926ccb3c0fd1457fd54863f8bc63d7b50174c09fc696894
MD5 10046f276beca1a234676f0395190ca2
BLAKE2b-256 ce27494187e32e2b2719ec9f17d49aedff83ab52a6465b800987a3a235a81ee4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for audidata-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1b4a139976de00a316f1f1309d5b2dabf2e7c5726e85901c94905d2bf6cae7d2
MD5 b3e0ed53b596e3c81e9705053c7a04f1
BLAKE2b-256 0f01f8a26a047e1260ce027ececcc294a9ef992da4829f19f3270019f483c4d7

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