Support remote file systems for `Audio`
NONE
Just seen https://github.com/huggingface/datasets/issues/5281
2022-12-12T13:37:14Z
https://github.com/huggingface/datasets/issues/5353#issuecomment-1346522450
https://api.github.com/repos/huggingface/datasets/issues/5353
IC_kwDODunzps5QQk1S
https://api.github.com/repos/huggingface/datasets/issues/comments/1346522450/reactions
2022-12-12T13:37:14Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1346522450
https://avatars.githubusercontent.com/u/46894149?v=4
https://api.github.com/users/OllieBroadhurst/events{/privacy}
https://api.github.com/users/OllieBroadhurst/followers
https://api.github.com/users/OllieBroadhurst/following{/other_user}
https://api.github.com/users/OllieBroadhurst/gists{/gist_id}
https://github.com/OllieBroadhurst
OllieBroadhurst
MDQ6VXNlcjQ2ODk0MTQ5
https://api.github.com/users/OllieBroadhurst/orgs
https://api.github.com/users/OllieBroadhurst/received_events
https://api.github.com/users/OllieBroadhurst/repos
https://api.github.com/users/OllieBroadhurst/starred{/owner}{/repo}
https://api.github.com/users/OllieBroadhurst/subscriptions
User
https://api.github.com/users/OllieBroadhurst
public
### Feature request

Hi there!

It would be super cool if `Audio()`, and potentially other features, could read files from a remote file system.

### Motivation

Large amounts of data is often stored in buckets. `load_from_disk` is able to retrieve data from cloud storage but to my knowledge actually copies the datasets across first, so if you're working off a system with smaller disk specs (like a VM), you can run out of space very quickly.

### Your contribution

Something like this (for Google Cloud Platform in this instance):



```python
from datasets import Dataset, Audio
import gcsfs

fs = gcsfs.GCSFileSystem()

list_of_audio_fp = {'audio': ['1', '2', '3']}
ds = Dataset.from_dict(list_of_audio_fp)

ds = ds.cast_column("audio", Audio(sampling_rate=16000, fs=fs))
```

Under the hood:
```python

import librosa
from io import BytesIO

def load_audio(fp, sampling_rate=None, fs=None):
    if fs is not None:
        with fs.open(fp, 'rb') as f:
            arr, sr = librosa.load(BytesIO(f), sr=sampling_rate)
    else:
        # Perform existing io operations
```

Written from memory so some things could be wrong.