To support decoding audio data, please install 'torchcodec'.
MEMBER
Hi ! yes you should `!pip install -U datasets[audio]` to have the required dependencies.

`datasets` 4.0 now relies on `torchcodec` for audio decoding. The `torchcodec` AudioDecoder enables streaming from HF and also allows to decode ranges of audio
2025-07-10T14:42:08Z
https://github.com/huggingface/datasets/issues/7678#issuecomment-3057752413
https://api.github.com/repos/huggingface/datasets/issues/7678
IC_kwDODunzps62QZld
https://api.github.com/repos/huggingface/datasets/issues/comments/3057752413/reactions
2025-07-10T14:42:08Z
https://api.github.com/repos/huggingface/datasets/issues/comments/3057752413
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
NONE
Same issues on Colab.

> !pip install -U datasets[audio] 

This works for me. Thanks.
2025-07-22T03:46:38Z
https://github.com/huggingface/datasets/issues/7678#issuecomment-3100712597
https://api.github.com/repos/huggingface/datasets/issues/7678
IC_kwDODunzps640R6V
https://api.github.com/repos/huggingface/datasets/issues/comments/3100712597/reactions
2025-07-22T03:46:52Z
https://api.github.com/repos/huggingface/datasets/issues/comments/3100712597
https://avatars.githubusercontent.com/u/58977158?v=4
https://api.github.com/users/LaiThePhong/events{/privacy}
https://api.github.com/users/LaiThePhong/followers
https://api.github.com/users/LaiThePhong/following{/other_user}
https://api.github.com/users/LaiThePhong/gists{/gist_id}
https://github.com/LaiThePhong
LaiThePhong
MDQ6VXNlcjU4OTc3MTU4
https://api.github.com/users/LaiThePhong/orgs
https://api.github.com/users/LaiThePhong/received_events
https://api.github.com/users/LaiThePhong/repos
https://api.github.com/users/LaiThePhong/starred{/owner}{/repo}
https://api.github.com/users/LaiThePhong/subscriptions
User
https://api.github.com/users/LaiThePhong
public

In the latest version of datasets==4.0.0, i cannot print the audio data on the Colab notebook. But it works on the 3.6.0 version.

!pip install -q -U datasets huggingface_hub fsspec

from datasets import load_dataset

downloaded_dataset = load_dataset("ymoslem/MediaSpeech", "tr", split="train")
print(downloaded_dataset["audio"][0])

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
[/tmp/ipython-input-4-90623240.py](https://localhost:8080/#) in <cell line: 0>()
----> 1 downloaded_dataset["audio"][0]

10 frames
[/usr/local/lib/python3.11/dist-packages/datasets/features/audio.py](https://localhost:8080/#) in decode_example(self, value, token_per_repo_id)
    170             from ._torchcodec import AudioDecoder
    171         else:
--> 172             raise ImportError("To support decoding audio data, please install 'torchcodec'.")
    173 
    174         if not self.decode:

ImportError: To support decoding audio data, please install 'torchcodec'. 

### Environment info

- `datasets` version: 4.0.0
- Platform: Linux-6.1.123+-x86_64-with-glibc2.35
- Python version: 3.11.13
- `huggingface_hub` version: 0.33.2
- PyArrow version: 18.1.0
- Pandas version: 2.2.2
- `fsspec` version: 2025.3.0