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.2.tar.gz (34.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.2-py3-none-any.whl (78.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: audidata-0.0.2.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for audidata-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f299542033e84ba9a4cba920fff538ec09972053abd1788dc2724e86b435a4a3
MD5 3e3ef10a103c36122c3b04b92a30c180
BLAKE2b-256 71a6d7a30dca0901cefb1a40541ac445a71fca6891f89dc951f8d3f145c5aaba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: audidata-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 78.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for audidata-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5c3f66475cbac614be19e6f60305250c3f99aa6c76d5e71e40c4ec9a905dfced
MD5 aedd39d8aa23e0b32cd71cd7c3e44255
BLAKE2b-256 0691ad05f54a8c7070dad0b7725ff116d73b39df5158fcc6779b70e80f808ad4

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