-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
zipped file with same size of original file #503
Comments
WAV files are a wrapper file type that can encompass different audio formats that include compression. Most likely the test.wav file is already compressed to a point where zip cannot make much headway on compressing the data any further. See: https://en.wikipedia.org/wiki/WAV |
test.wav is a recorded audio that originally was a PCM and then the wav header is added to... so, i'm sure that it is not compressed yet. |
zip.generateAsync({ No? PS with WAV no chances |
@dvdobrovolskiy thanks a lot! That is what actually does compression. The examples on the website just create zip and no compression at all. |
I would suggest changing the examples to default to compression, if not the API itself. I think most users would expect creating a zip file to do compression by default, as they would when creating a zip file through something like windows or 7zip does. With such ease of integration, I suspect many users make this same mistake and never actually check the size of the file to ensure it is compresed. Here is an example of another user who had the same issue on stack overflow: https://stackoverflow.com/questions/57866209/compressed-file-in-jszip-is-bigger-than-uncompressed-content/ I think having the examples on the website use compression would make users more likely to do what they want, and it is also more clear what is happening, since it clearly specifies that it is compresing. So if a user DOESN'T want compression they could remove or change the params. |
my code:
var zip = new JSZip(); zip.file('test.wav', blob); zip.generateAsync({type:"base64"}).then(function (base64) { window.location = "data:application/zip;base64," + base64; }, function (err) { console.log(err); });
The text was updated successfully, but these errors were encountered: