# Problem with Dataset Preview with audio files

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-with-dataset-preview-with-audio-files%2F31475%3E%5C
**Category:** 🤗Datasets\
**Created:** [February 10, 2023, 9:38pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-with-dataset-preview-with-audio-files%2F31475 "2023-02-10T21:38:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![j-krzywdziak](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/j-krzywdziak/32/18678_2.png) [@j-krzywdziak](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fj-krzywdziak)%5C
**Post date:** [February 10, 2023, 9:38pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-with-dataset-preview-with-audio-files%2F31475%2F1 "2023-02-10T21:38:16Z")

</div>

Hi, I am looking for a help with my test dataset. I plan to upload large dataset on Hugging Face but first I wanted to experiment and learn how to stream audio data. I have a problem with Dataset Preview. I cannot get the audio probes to listen in preview. My dataset will consist of audio in mp3 format packed in tar.gz file and a metadata in .tsv file format with audio name and some description. Can you please help me and maybe tell what I did wrong in my dataloader [test.py · j-krzywdziak/test at main](https://huggingface.co/datasets/j-krzywdziak/test/blob/main/test.py) that I cannot preview the audio correctly. Any tip will be helpful, because this is my first time with Hugging Face and I am still a little bit unsure about how it works. Unfortunately documentation did not help. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![lhoestq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lhoestq/32/52888_2.png) [@lhoestq](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Flhoestq)%5C
**Post date:** [February 23, 2023, 11:39am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-with-dataset-preview-with-audio-files%2F31475%2F2 "2023-02-23T11:39:21Z")

</div>

cc @severo do you know what could be the issue ?

The dataset script is correct and the dataset is streamable, but it seems to return one mp3 and one wav for the preview for some reason

---

<div class="post-metadata">

**Author:** ![polinaeterna](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/polinaeterna/32/19055_2.png) [@polinaeterna](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpolinaeterna)%5C
**Post date:** [February 24, 2023, 12:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-with-dataset-preview-with-audio-files%2F31475%2F3 "2023-02-24T12:09:08Z")

</div>

@lhoestq @j-krzywdziak hey! this is weird but I tried to change config name from “Test Dataset” to “test-dataset” (to exclude space) and it worked (I cloned the repo, you can check here: [polinaeterna/test-user · Datasets at Hugging Face](https://huggingface.co/datasets/polinaeterna/test-user))

---

<div class="post-metadata">

**Author:** ![severo](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/severo/32/27449_2.png) [@severo](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsevero)%5C
**Post date:** [February 27, 2023, 8:33am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-with-dataset-preview-with-audio-files%2F31475%2F4 "2023-02-27T08:33:19Z")

</div>

I created an issue: [Support all the characters in dataset, config and split · Issue #853 · huggingface/datasets-server · GitHub](https://github.com/huggingface/datasets-server/issues/853)

---

<div class="post-metadata">

**Author:** ![gcjavi](https://avatars.discourse-cdn.com/v4/letter/g/e9a140/32.png) [@gcjavi](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fgcjavi)%5C
**Post date:** [March 5, 2024, 1:42pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-with-dataset-preview-with-audio-files%2F31475%2F5 "2024-03-05T13:42:33Z")

</div>

Hi @polinaeterna, I need to publish an ASR dataset an I would like to show the audios in the dataviewer along with the .tsv data but I don’t know how. After several unsuccessful attempts, I found your repo and tried to replicate it as a first step [gcjavi/dataviewer-tests](https://huggingface.co/datasets/gcjavi/dataviewer-test) only changing the content of the .zip file with some audio files from my dataset and also the .tsv file with the transcriptions. However, the dataviewer only shows the audio fragments and the .tsv files are ignored. Do you know why it could be happening? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![polinaeterna](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/polinaeterna/32/19055_2.png) [@polinaeterna](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpolinaeterna)%5C
**Post date:** [March 7, 2024, 11:15am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-with-dataset-preview-with-audio-files%2F31475%2F6 "2024-03-07T11:15:47Z")

</div>

hi @gcjavi ! the recommended approach currently is to use no-code dataset configuration without custom dataset scripts, in your case you can use [`AudioFolder`](https://huggingface.co/docs/datasets/audio_dataset#audiofolder) structure for your repository to make the viewer work correctly. You need to structure your data according to the documentation, note that file with transcriptions must be called `metadata.csv` / `metadata.jsonl` and column names also should be strictly `file_name` and `transcription`. and you should delete python script, and update/delete README’s `dataset_info` field too to avoid mismatch between features and config names.

This should work, until you have a really huge dataset. In the latter case I recommend to first create a dataset locally with your custom code in python (you might find [`Dataset.from_generator()`](https://huggingface.co/docs/datasets/loading#python-generator) useful) and then use [`.push_to_hub()`](https://huggingface.co/docs/datasets/main/en/package_reference/main_classes#datasets.DatasetDict.push_to_hub) to push the data to a Hub repo in parquet format.

Let me know if that worked 🙂

---

<div class="post-metadata">

**Author:** ![gcjavi](https://avatars.discourse-cdn.com/v4/letter/g/e9a140/32.png) [@gcjavi](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fgcjavi)%5C
**Post date:** [March 7, 2024, 12:58pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-with-dataset-preview-with-audio-files%2F31475%2F7 "2024-03-07T12:58:06Z")

</div>

Thank you very much for your quick reply. I tried in a small dataset and this structure works perfectly. Next step is trying to upload a bigger dataset, I will test the the push\_to\_hub() method as you pointed. Thanks! 😁

---

<div class="post-metadata">

**Author:** ![pr0mila-gh0sh](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pr0mila-gh0sh/32/45720_2.png) [@pr0mila-gh0sh](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpr0mila-gh0sh)%5C
**Post date:** [April 17, 2025, 12:26pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-with-dataset-preview-with-audio-files%2F31475%2F8 "2025-04-17T12:26:44Z")

</div>

I’ve developed a project that streams audio in the datasets viewer on Hugging Face using Parquet format.

> **[GitHub - pr0mila/ParquetToHuggingFace: ParquetToHuggingFace processes raw audio data,...](https://github.com/pr0mila/ParquetToHuggingFace)**
>
> ParquetToHuggingFace processes raw audio data, converts it into Parquet files, and uploads them to Hugging Face. The README explains how to set up the environment, configure paths, and run the scripts to generate and upload the data.
