---
source: https://iinventedlight.com/library/notes/hf-datasets-audio-loading.md
title: "Load audio datasets with Hugging Face Datasets"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (huggingface/datasets docs); restated in our own words"
attribution: "Summary by iinventedlight (AI-assisted). Sources: Hugging Face (Datasets docs), Load audio data · Hugging Face, Apache-2.0 (huggingface/datasets docs); Hugging Face, Process audio data, Apache-2.0 (huggingface/datasets docs)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-05
as_of: 2026-11-05
confidence: medium
untested: "No code was run; only the fetched Hugging Face documentation pages were read."
category: huggingface-datasets
topic_area: "datasets: audio"
tags: huggingface, datasets, audio, audiofolder
sources:
  - id: S1
    title: "Load audio data · Hugging Face"
    publisher: Hugging Face (Datasets docs)
    url: https://huggingface.co/docs/datasets/audio_load
    accessed: 2026-11-05
    license: "Apache-2.0 (huggingface/datasets docs)"
  - id: S2
    title: "Process audio data"
    publisher: Hugging Face
    url: https://huggingface.co/docs/datasets/audio_process
    accessed: 2026-11-05
    license: "Apache-2.0 (huggingface/datasets docs)"
    license: "Apache-2.0 (huggingface/datasets docs)"
---
# Hugging Face Datasets: load audio

## Short answer
Audio columns decode on access. Point `Audio` / `cast_column` at file paths (or use AudioFolder) so examples yield arrays plus sampling rate. [S1]

## Points
- Decoding and resampling can happen when you read an example. [S1]
- Metadata needs a `file_name` column that matches files. [S1]
- After loading, `cast_column` and resampling helpers prepare training features. [S2]

## Claims
- id: C1
  claim: Audio files are decoded and resampled when accessed.
  source: S1
  evidence: "automatically decodes and resamples the audio files when you access the examples"
- id: C2
  claim: Metadata must include a file_name column.
  source: S1
  evidence: "Your metadata.csv file must have a file_name column"
- id: C3
  claim: cast_column casts a column to a decoded feature.
  source: S1
  evidence: "Use the cast_column() function to take a column of audio file paths"
- id: C4
  claim: Audio processing includes resampling the sampling rate.
  source: S2
  evidence: "Resample the sampling rate"

## Sources
- [S1] Load audio data · Hugging Face. Hugging Face (Datasets docs). https://huggingface.co/docs/datasets/audio_load . License: Apache-2.0 (huggingface/datasets docs). Accessed 2026-11-05.
- [S2] Process audio data. Hugging Face. https://huggingface.co/docs/datasets/audio_process . License: Apache-2.0 (huggingface/datasets docs). Accessed 2026-11-05.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

Source notice: Hugging Face Datasets documentation, Apache License 2.0 (https://github.com/huggingface/datasets/blob/main/LICENSE).
