[Audio] Allow resampling for audio datasets in streaming mode
MEMBER
This requires implementing `cast_column` for iterable datasets, it could be a very nice addition !

<s>It can also be useful to be able to disable the audio/image decoding for the dataset viewer (see PR https://github.com/huggingface/datasets/pull/3430) cc @severo </s>
EDIT: actually following https://github.com/huggingface/datasets/issues/3145 the dataset viewer might not need it anymore
2021-12-14T14:58:20Z
https://github.com/huggingface/datasets/issues/3369#issuecomment-993628039
https://api.github.com/repos/huggingface/datasets/issues/3369
IC_kwDODunzps47OY-H
https://api.github.com/repos/huggingface/datasets/issues/comments/993628039/reactions
2021-12-14T15:36:54Z
https://api.github.com/repos/huggingface/datasets/issues/comments/993628039
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
CONTRIBUTOR
Just to clarify a bit. This feature is **always** needed when using the common voice dataset in streaming mode. So I think it's quite important
2021-12-14T18:58:34Z
https://github.com/huggingface/datasets/issues/3369#issuecomment-993884346
https://api.github.com/repos/huggingface/datasets/issues/3369
IC_kwDODunzps47PXi6
https://api.github.com/repos/huggingface/datasets/issues/comments/993884346/reactions
2021-12-14T18:58:34Z
https://api.github.com/repos/huggingface/datasets/issues/comments/993884346
https://avatars.githubusercontent.com/u/23423619?v=4
https://api.github.com/users/patrickvonplaten/events{/privacy}
https://api.github.com/users/patrickvonplaten/followers
https://api.github.com/users/patrickvonplaten/following{/other_user}
https://api.github.com/users/patrickvonplaten/gists{/gist_id}
https://github.com/patrickvonplaten
patrickvonplaten
MDQ6VXNlcjIzNDIzNjE5
https://api.github.com/users/patrickvonplaten/orgs
https://api.github.com/users/patrickvonplaten/received_events
https://api.github.com/users/patrickvonplaten/repos
https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}
https://api.github.com/users/patrickvonplaten/subscriptions
User
https://api.github.com/users/patrickvonplaten
public
Many audio datasets like Common Voice always need to be resampled. This can very easily be done in non-streaming mode as follows:

```python
from datasets import load_dataset

ds = load_dataset("common_voice", "ab", split="test")

ds = ds.cast_column("audio", Audio(sampling_rate=16_000))
```

However in streaming mode it fails currently:

```python
from datasets import load_dataset

ds = load_dataset("common_voice", "ab", split="test", streaming=True)

ds = ds.cast_column("audio", Audio(sampling_rate=16_000))
```

with the following error:

```
AttributeError: 'IterableDataset' object has no attribute 'cast_column'  
```

It would be great if we could add such a feature (I'm not 100% sure though how complex this would be)