-
Notifications
You must be signed in to change notification settings - Fork 145
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
x2 speed reading ID3v2 tags. #26
base: master
Are you sure you want to change the base?
Conversation
Need add ID3v2.readSynchsafeInteger32At = readSynchsafeInteger32At; in ID3v2
update, https://github.com/Feverqwe/JavaScript-ID3-Reader/commit/abb3fedb50feeed3574ae0fbd1e0620c2ce6a3b1 |
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 :-) |
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 |
It's definitely a step in the right direction but I was not thinking about creating a new |
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... |
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. |
I didn't have any problems in my tests, I was able to read images just fine. |
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 |
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.). |
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. |
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. |
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!) |
yes bufferedfilereader.js sounds better =) Thanks for a great library. |
Need add ID3v2.readSynchsafeInteger32At = readSynchsafeInteger32At;
in ID3v2