So I basically am trying to save a mp3 file that I get using jQuery. First problem is that the size of saved blob is almost 2 times bigger than the download size. Another problem is that the downloaded file isn't being recognized as a audio file. Neither in browser when adding blob as audio source neither desktop audio players.
This is the bit I use for getting and saving the data.
$.get(fileUrl, function(song_data) {
var blob = new Blob([song_data], {type: "audio/mpeg"});
saveAs(blob, songName);
});
And the blob that I make:
Blob {size: 13821949, type: "audio/mp3"}
These are also the Response Headers from the same URL that I download.
HTTP/1.1 200 OK
Date: Tue, 10 Jan 2017 18:43:42 GMT
Server: Apache
X-Powered-By: PHP/5.3.3
Cache-Control: public, must-revalidate, max-age=0
Pragma: no-cache
Content-Length: 7832555
Content-Disposition: inline; filename=5b6wgswib0.mp3
Content-Transfer-Encoding: binary
Last-Modified: Tue, 05 May 2015 08:58:26 +0300
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Content-Type: audio/mpeg