Handle empty audio
COLLABORATOR
Hi! Can you share one of the problematic audio files with us?

I tried to reproduce the error with the following code: 
```python
import soundfile as sf
import numpy as np
from datasets import Audio

sf.write("empty.wav",  np.array([]), 16000)
Audio(sampling_rate=24000).decode_example({"path": "empty.wav", "bytes": None})
```
But without success.

Also, what version of `librosa` is installed in your env? (You can get this info with `python -c "import librosa; print(librosa.__version__)`)


2023-04-13T17:33:36Z
https://github.com/huggingface/datasets/issues/5716#issuecomment-1507357463
https://api.github.com/repos/huggingface/datasets/issues/5716
IC_kwDODunzps5Z2HMX
https://api.github.com/repos/huggingface/datasets/issues/comments/1507357463/reactions
2023-04-13T17:33:36Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1507357463
https://avatars.githubusercontent.com/u/47462742?v=4
https://api.github.com/users/mariosasko/events{/privacy}
https://api.github.com/users/mariosasko/followers
https://api.github.com/users/mariosasko/following{/other_user}
https://api.github.com/users/mariosasko/gists{/gist_id}
https://github.com/mariosasko
mariosasko
MDQ6VXNlcjQ3NDYyNzQy
https://api.github.com/users/mariosasko/orgs
https://api.github.com/users/mariosasko/received_events
https://api.github.com/users/mariosasko/repos
https://api.github.com/users/mariosasko/starred{/owner}{/repo}
https://api.github.com/users/mariosasko/subscriptions
User
https://api.github.com/users/mariosasko
public
COLLABORATOR
I'm closing this issue as the reproducer hasn't been provided.
2023-09-27T17:47:05Z
https://github.com/huggingface/datasets/issues/5716#issuecomment-1737831312
https://api.github.com/repos/huggingface/datasets/issues/5716
IC_kwDODunzps5nlTOQ
https://api.github.com/repos/huggingface/datasets/issues/comments/1737831312/reactions
2023-09-27T17:47:05Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1737831312
https://avatars.githubusercontent.com/u/47462742?v=4
https://api.github.com/users/mariosasko/events{/privacy}
https://api.github.com/users/mariosasko/followers
https://api.github.com/users/mariosasko/following{/other_user}
https://api.github.com/users/mariosasko/gists{/gist_id}
https://github.com/mariosasko
mariosasko
MDQ6VXNlcjQ3NDYyNzQy
https://api.github.com/users/mariosasko/orgs
https://api.github.com/users/mariosasko/received_events
https://api.github.com/users/mariosasko/repos
https://api.github.com/users/mariosasko/starred{/owner}{/repo}
https://api.github.com/users/mariosasko/subscriptions
User
https://api.github.com/users/mariosasko
public
Some audio paths exist, but they are empty, and an error will be reported when reading the audio path.How to use the filter function to avoid the empty audio path?
when a audio is empty, when do resample , it will break:
`array, sampling_rate = sf.read(f) array = librosa.resample(array, orig_sr=sampling_rate, target_sr=self.sampling_rate)`