Parisson / TimeSide

scalable audio processing framework and server written in Python
https://timeside.ircam.fr/docs/
GNU Affero General Public License v3.0
369 stars 59 forks source link

Seeking support through restful API #156

Open faroit opened 4 years ago

faroit commented 4 years ago

is there a way to get chunked audio through the restful API, assuming seeking is supported for the requested format (e.g. WAV, OGG)

faroit commented 4 years ago

@yomguy isn't this already implemented here?

https://github.com/Parisson/TimeSide/blob/64303570e95d5744f7969be9a5c38823c9863aee/timeside/server/views.py#L529-L530

So this could be easily passed as an argument from the api, right?

yomguy commented 4 years ago

@faroit that's right, we should add those parms to the API.

Could you please specify your own usecase need a little bit? For example, do you need to access to the source stream or to a transcoded one?

faroit commented 4 years ago

Could you please specify your own use case need a little bit?

we have two use-cases:

a) some of our deep learning inference model can only process chunks of a few seconds and therefore would stream the chunks directly from the timeside api. For this to work, the chunking would need to make sure that no samples are dropped. This might be a bit difficult for transcoded streams such as mp3 (as the encoder usually add few zero samples)

b) a client requests a full transcoded (and heavily compressed) file to the client and a user specifies a range to be processed in a second step. Then the source stream or a safe transcoded format (ogg, flac?) is requested using start and stop to reduce bandwidth.

As we need to deploy this pretty quickly (we are still running 0.8.1) it would be great if this could be added to the master or dev branch in a way it can be cherry picked easily. Also I can certainly implement this myself if you provide some proposal how you would add this feature.