Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is decoding a specific part of a gargantuan file supported efficiently? #212

Open
JohnWeisz opened this issue Apr 6, 2019 · 3 comments
Open

Comments

@JohnWeisz
Copy link

JohnWeisz commented Apr 6, 2019

Good afternoon, and thanks for your work on this project.

We are interested in trying out Aurora.js for a new streaming-audio-resource system that requires on-demand random access for specific time ranges. For example, given a 10-hour long mp3 file, I'm wondering if it's possible to extract audio samples from 3:10:00 to 3:10:20, without reading the entire file into memory, or even the part leading up to the requested time-range.

The docs specify 2 use-cases:

  • Running playback at live listening rate to get audio samples (Asset.start and Asset.stop)
  • Decoding the entire thing into a buffer (Asset.decodeToBuffer, this is obviously unusable)

Basically, what I'm wondering about is whether a combination of these 2 is supported.
Thanks.

@JohnWeisz JohnWeisz changed the title Is decoding a part of a gargantuan file supported efficiently? Is decoding a specific part of a gargantuan file supported efficiently? Apr 6, 2019
@JohnWeisz
Copy link
Author

After some investigation, it seems this should be possible by accessing the Decoder directly, I'll report back with further progress.

@JohnWeisz
Copy link
Author

JohnWeisz commented Apr 7, 2019

From the code it seems this isn't possible in the end (by just inspecting FileSource, it apparently doesn't have anything related to seeking).

But I might be totally wrong here, because to me it doesn't sound viable to not have actual stream seeking and have to download hours of audio before being able to seek to a specific position.

@jayarjo
Copy link

jayarjo commented Jan 26, 2020

@JohnWeisz how did it went for you in the end? @devongovett I wonder the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants