x2 speed reading ID3v2 tags. - #26
Conversation
Need add ID3v2.readSynchsafeInteger32At = readSynchsafeInteger32At; in ID3v2
Feverqwe
commented
Nov 25, 2013
update, https://github.com/Feverqwe/JavaScript-ID3-Reader/commit/abb3fedb50feeed3574ae0fbd1e0620c2ce6a3b1 |
aadsm
commented
Nov 26, 2013
The I think the best option is to create something similar to https://github.com/aadsm/JavaScript-ID3-Reader/blob/master/src/bufferedbinaryajax.js#L231-L240 The current architecture is not ideal but it served its purpose at the time, I haven't had the time to rewrite it, so it is what it is :-) |
Feverqwe
commented
Nov 26, 2013
I'am add BufferedBinaryFileReader! Note, have big problem with getBlockAtOffset, I don't know how fix it, need callback. https://github.com/Feverqwe/JavaScript-ID3-Reader/commit/768928004cfa0cfe059b2f01fe91426f93e9e86a |
aadsm
commented
Nov 26, 2013
It's definitely a step in the right direction but I was not thinking about creating a new |
aadsm
commented
Nov 29, 2013
I've used your code to create a BufferedFileAPIReader, I created a branch with it, can you try it out? https://github.com/aadsm/JavaScript-ID3-Reader/tree/pr-26 What do you mean with having a big problem with There's still a lot of duplicated code, the problem of not using prototype inheritance... |
Feverqwe
commented
Nov 30, 2013
When I tested this code, part of the images were broken, it's probably due to the fact that not all the relevant part of the file is loaded. I will try to implement this option, but it requires some time. |
aadsm
commented
Nov 30, 2013
I didn't have any problems in my tests, I was able to read images just fine. |
Feverqwe
commented
Nov 30, 2013
You won't have problems because blockSize in most cases covers the required part. Need to change some of the range for loadRange then blockSize is not required. If you would be interested, I slightly changed the way of getting the picture, this works much better than the one that was before, but changes the type of the output ( from getBytesAt to getStringAt ). And I write script for windows |
Feverqwe
commented
Nov 30, 2013
I'am update bufferedbinaryfilereader, remove blockSize, add Uint8Array, and now it very small and fast reader =) https://github.com/Feverqwe/JavaScript-ID3-Reader/commit/d76672bd57e50ac612242664e6f74a0320d61617 ID3v2 ID3v1 and should work well, as they have the specified size. ID4 like also works not bad. I made a small change in ID3v2. upd. now work ID4, many fix's with ranges. https://github.com/Feverqwe/JavaScript-ID3-Reader/commit/941ebc1d0de9781ba123dc0ce5fb2cd2b8515a80 see last version file (I can change something.). |
aadsm
commented
Nov 30, 2013
Great work Anton, thank you so much! This is what I was going to do this morning but even more :-) I've added comments to your two commits, I don't think I understand the motivation behind the changes in ID4. |
Feverqwe
commented
Nov 30, 2013
Just.. uncomment console.log in bufferedbinaryfilereader.js, and it show all unloaded blocks, it don't all fix's, but it work. I sometimes difficult to understand code and specifications, but it seems now it works not bad. |
aadsm
commented
Nov 30, 2013
Thanks for all your comments and fixes (it seems that I can't do basic math :D) Greetings from California to Ufa (which is one of the Russian cities marked in my world map shower curtain!) |
Feverqwe
commented
Nov 30, 2013
yes bufferedfilereader.js sounds better =) Thanks for a great library. |
Need add ID3v2.readSynchsafeInteger32At = readSynchsafeInteger32At;
in ID3v2