Comments (11)
Thanks @Nailik this is a life saver!
To give a little more context, before adding the fix, parsing 100 mp3 files of around 80mb in total took 500+ seconds to complete and from time to time crashes my app. After the fix, it only took ~15 seconds to extract all the tags from the same number of mp3 files!
from dart-tags.
Thank's @NiKoTron, yeah it's solved.
from dart-tags.
Hi @o4x, can you explain more detailed, what do you mean by slow? Any measurements or smth. else..
from dart-tags.
@NiKoTron when I use getTagFromByteArray in my project ui lagged and when use it on isolate take one or two seconds to return tags. its very much
Can we do it faster?
from dart-tags.
@o4x, Actually, I think we can. Currently, library looking through the whole file while scanning tags. Of course, It isn't a cheap operation and if you have a quite big file and slow IO. It's really may become a cause of slow parse. Well, I'll plan this for the next release.
Thank you for the helpful feedback!
from dart-tags.
@o4x, Well I've rechecked it. The feature is that the file is reading only in the tag area has already been implemented.
I did some benchmarks and, It looks like bottleneck is file.readAsBytes()
, cuz for parsing via getTagFromByteArray
we must have a complete byte array of a file in the RAM.
Can you tell me what file do you parse (size and which tags) and on what's hardware do you you use (especially which kind of hard\solid state drive)?
So, I'll implement API that will accept the stream as an argument.
from dart-tags.
@NiKoTron I'm sorry I wasn't here for a while, I use profile mode in flutter and test it on my real phone .
Its specifications are as follows:
Memory | Storage | System on chip |
---|---|---|
4 GB LPDDR4X RAM | 64 GB UFS 2.1 | Snapdragon 835 |
And the size of my songs is about 10 Mb .
output
I/flutter ( 3706): album: 慒楤慫�
I/flutter ( 3706): artist: 䅀捲楨敶也橡晡�
I/flutter ( 3706): genre: 汆浡湥潣
I/flutter ( 3706): title: 汁桥
I/flutter ( 3706): track: 㔰ㄯ�
I/flutter ( 3706): year: 〲㜱
I/flutter ( 3706): comment: {language:eng, description:, body:
I/flutter ( 3706): lyrics: 湥ァ�䃾牁档癩彥慎慪楦دنیا⠠䜆 درکㄠ䄆⨆ و⼠䜆 بی㌠ㄆ و㌠✆䔆✆䘆 شد㌠䜆䔆 من䠠 تو✠㈆ آن찠꤆ سفره찠 بی䘠✆䘆 شداز蘠㐆䔆 کبو倠⼆ ما†هی✠㐆꤆ بهㄠ✆䜆 افتاد✠匆䘆䈆⼆ㄆ که⠠✆ㄆ찆⼆찆䔆 تبدیل⠠䜆 باران㐠⼆ആ䜊ㄆ دوستꤠ䜆 با䔠✆ بود⼠㐆䔆䘆 شد䠠 خنجر㈠⼆ با䈠✆䄆䐆䜆 پیمان⠠㌆⨆ همꤠ✆㌆䜆 ِی⼠㈆⼆✆䘆 شدپ㐠 ِت䜠䔆䜆 ِی⼠ رها⼠찆䠆✆ㄆ کشیدند䠠 هی㌠䈆䄆 فرو縠✆㐆찆⼆ هی縠䘆Ⰶㄆ䜆 سیمان㐠⼆ആ䜊찆 شهد䠠 شکر⼠✆⼆䘆⼆℆䜠찆 سکه찠 زر⼠✆⼆䘆⼆℆✠匆ㄆ✆䔆 بسا倠㜆 شعر⨠⠆⼆찆䐆 به⼠꤆✆䘆 شدهرꤠ㌆ که⼠䐆㐆 میخواست䘠찆㈆䜆 به㈠䔆찆䘆 کوبید䜠찆 کشت䠠 تجاوزꤠㄆ⼆ تا�
I/flutter ( 3706): picture: {mime:image/jpeg, description:, bitmap: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAPoA+gDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCjZ/PNBCv9/wD1j/5/76raf5EeOOdE3zb33/xr/wABqrDc/ufLZPPdX/c/7a7furtqPTblbl0Vv3flP8n991/utX1Z+dEjzSPvaZN6fM6f30bd8tFhbXSTI0kHkIqbHj8tf33+zTkfZDPJJB
And as you can see in the example, Persian language is not supported either.
from dart-tags.
In version 0.2.3, the Persian language works well.
from dart-tags.
The problem i found is (for me) in id3v2.dart
There the end of the information get's recognized by end = offset < size;
(line 73). This is really a problem as it will scan every bytes of the song for header information including just the sound. So i changed it a little bit, when the first tag result m
is null
i set end = false
so it will stop after last tag is read.
This should not make any problems as the song tags should not have empty tags in between.
This is the commit in my fork: aa1f777
from dart-tags.
hi @o4x, @n3rfd ! this issue should be solved in the latest version (0.3.0) could you please check it?
from dart-tags.
@o4x, Well I've rechecked it. The feature is that the file is reading only in the tag area has already been implemented.
I did some benchmarks and, It looks like bottleneck is
file.readAsBytes()
, cuz for parsing viagetTagFromByteArray
we must have a complete byte array of a file in the RAM.Can you tell me what file do you parse (size and which tags) and on what's hardware do you you use (especially which kind of hard\solid state drive)?
So, I'll implement API that will accept the stream as an argument.
Is accepting a stream as an argument still planned?
from dart-tags.
Related Issues (20)
- Decode HOT 3
- Ram Consumption HOT 9
- Lyrics Tag showing undefined characters [working solution implemented already] HOT 4
- Picture tag is no longer being extracted HOT 3
- 32 bit integer frame size for USLT ?? HOT 3
- Error on 'Other' APIC picture type HOT 3
- DTB- Can't parse Chinese/Japanese/Korean characters
- Can this library write tags to files ?
- Can't set null tags
- DTB- Invalid value not in range HOT 2
- Web Support? HOT 2
- Non-ASCII Glyphs don't work. HOT 1
- DTB- Bitrate not found in the tags HOT 1
- DTB-Can't catch an error on the TagProcessor().getTagsFromByteArray HOT 5
- DTB-It can't decode album cover image of some mp3 files. HOT 1
- Parse and return the POPM frame
- DTB-Crashes on ID3 2.2.0
- Can this be used if the mp3 file is remote i.e a url? HOT 1
- Can't get album cover if image size is over or equal 1 mb
- Unable to catch error "Unhandled Exception: NoSuchMethodError: The method 'decode' was called on null."
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart-tags.