beetbox / audioread

cross-library (GStreamer + Core Audio + MAD + FFmpeg) audio decoding for Python
MIT License
481 stars 108 forks source link

In memory decoding #53

Open akademi4eg opened 7 years ago

akademi4eg commented 7 years ago

Hi guys! I have audio files contents stored in-memory and need to decode audio. In current version all backends accept pathlike argument (which is then passed to open()).

Are there any plans to extend your interface to also accept streams of data (e.g. BytesIO)?

akademi4eg commented 7 years ago

I use only wav-files and already have implementation for them. Would you accept a PR with updated RawAudioFile backend?

sampsyo commented 7 years ago

Yep! We're working on that in #35 and #37. The latter has a basically-working implementation for in-memory decoding for one backend, FFmpeg. There are just a few more details to hammer out with the high-level interface, and it would be great to have a raw-audio backend too! If you're interested in taking the lead, I'd be very enthusiastic (and I'd help!).

jksinton commented 7 years ago

The branch under development for this is:

https://github.com/beetbox/audioread/tree/compressed-audio

I'm using this branch in another project to decode mp3 data. See e.g., https://github.com/jksinton/littlesleeper2/blob/master/littlesleeper.py#L453