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

fix: batch network requests in fetchAudio #102

Merged
merged 3 commits into from
Jan 24, 2024
Merged

Conversation

davwheat
Copy link
Collaborator

I decided to set my device on fire by asking Crunker to concatenate about 2800 mp3 files into one wav.

Crunker was fine to do this, but Chrome refused and failed some of the network requests, rather understandably.

To work around ERR::INSUFFICIENT_RESOURCES, I have implemented a batching mechanism into fetchAudio so Crunker will only attempt to fetch 200 files at any one time. This worked fine in my browser on the same set of 2800 files.

(For anyone wondering, the resulting WAV file was about 256 MB.)

@davwheat davwheat requested a review from jaggad December 22, 2023 03:50
@davwheat davwheat self-assigned this Dec 22, 2023
src/crunker.ts Show resolved Hide resolved
@davwheat davwheat requested a review from jaggad January 20, 2024 10:45
@jaggad jaggad merged commit 3fe9501 into master Jan 24, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants