I'm a software developer and teamleader a bit ))
I'm using GitHub for my personal projects.
There are little statistic about languages that I'm using in my work:
- 3D LUT transformation on dart language dart-lut
ID3 Tag parser written on the pure dart language.
Home Page: https://pub.dartlang.org/packages/dart_tags
License: MIT License
Describe the bug
Hi, Can this be used if the mp3 file is remote i.e a url?
Any MP3s with either Greek or Latin characters come up blank for the respective fields with the offending characters.
Not all the MP3 can be decoded and the console return
[VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: NoSuchMethodError: The method 'decode' was called on null. Receiver: null Tried calling: decode(Uint8Array) #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5) #1 ID3V2Reader.parseValues package:dart_tags/…/readers/id3v2.dart:71 #2 Reader.read.<anonymous closure> package:dart_tags/…/readers/reader.dart:13 #3 _rootRunUnary (dart:async/zone.dart:1362:47) <asynchronous suspension>
But the error cannot be catch on try catch or .catchError()
The code just stops at await tp.getTagsFromByteArray(bytes)
, therefore i can't handle the error.
since 0.3.0
from @n3rfd message:
picture tag is no longer being extracted and returned from calling getTagsFromByteArray()
This is a great library. It has a problem of using a lot of Ram tho. It seems to use up all the available ram to extract the tags and when modifying those tags writing them back does the same thing.
I am running this on a Windows machine because I want to make it for both android and windows
Environment
When i try to include a string greater than or equal to 46 bytes, the writing fails on that mp3 file. It may be true for other tags as well, but observed this on artist tag as am having quite lengthy strings in there.
Example artist string which writes successfully:
Ilaiyaraaja, K. S. Chithra, S. P. Balasubrahmanyam
Example artist string which fails:
Ilaiyaraaja, K. S. Chithra, S. P. BalasubrahmanyamT
I found lyrics is mis-decoding.
With some debugging, I found the fact that USLT actually uses 32bit integer for frame size.
(what about the other frame?)
If we change USLT frame size to 32 bit integer instead of the sync safe integer, it works.
Describe the bug
an error happens when reading tags from byteArray and I can't catch it, it will always crash my code and stop everything I am doing.
The error is when decoding comments, see exact error below
Environment
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The error might happen, but I need to be able to catch it.
Additional context
[ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: RangeError (end): Invalid value: Not in inclusive range 3..20: 0
E/flutter (26269): #0 RangeError.checkValidRange (dart:core/errors.dart:357:9)
E/flutter (26269): #1 _TypedIntListMixin.sublist (dart:typed_data-patch/typed_data_patch.dart:462:31)
E/flutter (26269): #2 COMMFrame.decodeBody (package:dart_tags/src/frames/id3v2/comm_frame.dart:35:47)
E/flutter (26269): #3 ID3V2Frame.decode (package:dart_tags/src/frames/id3v2/id3v2_frame.dart:57:39)
E/flutter (26269): #4 ID3V2Reader.parseValues (package:dart_tags/src/readers/id3v2.dart:71:23)
E/flutter (26269): #5 Reader.read.<anonymous closure> (package:dart_tags/src/readers/reader.dart:13:23)
E/flutter (26269): #6 _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter (26269): #7 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (26269): #8 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
E/flutter (26269): #9 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
E/flutter (26269): #10 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
E/flutter (26269): #11 Future._addListener.<anonymous closure> (dart:async/future_impl.dart:393:9)
E/flutter (26269): #12 _rootRun (dart:async/zone.dart:1190:13)
E/flutter (26269): #13 _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter (26269): #14 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
E/flutter (26269): #15 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
E/flutter (26269): #16 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
E/flutter (26269): #17 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
E/flutter (26269):
Describe the bug
It cannot decode the album image of some mp3 files. I've also tried pasting the imageData(Base64 string) that I got from tag.tags['picture'] into https://base64.guru/converter/decode/file just to check if it will work but it also failed.
Environment
To Reproduce
Steps to reproduce the behavior:
Produces exception since imageData is invalid.
NOTE: Some mp3s are working and some are not. If you want me to send the sample mp3 file, please let me know your email.
Thanks
Hello,
I would like to be able to use this library with flutter web, but I am having trouble because this library uses files defined from dart:io and not dart:html. Dart:io is not supported in flutter web, so I am not sure why this library is labelled as working with flutter web?
When I read the ID3 tags from a file I get two entries, one with v1.1 and one with v2.3.0 which is fine, I can filter them so I only get those with version v2.3.0 but I was just wondering if this is safe, or if there is a better way to do this. The tag processor doesn't seem to take a constructor argument so I wonder how this could be done in a clean way.
test('Wrong APIC tags decoding on on Other picture type.', () async {
final pic1 = AttachedPicture(
'image/jpeg', 0x00, 'foo.jpg', picture.readAsBytesSync());
final tag = Tag()
..tags = {'picture': pic1}
..type = 'ID3'
..version = '2.4';
final writer = ID3V2Writer();
final blocks = writer.write(await file2.readAsBytes(), tag);
final r = ID3V2Reader();
final f = await r.read(blocks);
// ignore: avoid_as
final AttachedPicture pic = (f.tags['picture'] as Map).values.first;
expect(pic, equals(pic1));
});
this test will gerenate an error
Describe the bug
i can't find a way to set tags as null like album or artist, i always et the error "The getter 'length' was called on null."
Environment
To Reproduce
Steps to reproduce the behavior:
Expected behavior
being able to set tags to null
Additional context
the error in full :
E/flutter ( 5639): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: NoSuchMethodError: The getter 'length' was called on null.
E/flutter ( 5639): Receiver: null
E/flutter ( 5639): Tried calling: length
E/flutter ( 5639): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
E/flutter ( 5639): #1 Utf8Encoder.convert (dart:convert/utf.dart:88:31)
E/flutter ( 5639): #2 Codec.encode (dart:convert/codec.dart:21:32)
E/flutter ( 5639): #3 DefaultFrame.encode (package:dart_tags/src/frames/id3v2/default_frame.dart:19:25)
E/flutter ( 5639): #4 ID3V2Writer.prepareTag.<anonymous closure> (package:dart_tags/src/writers/id3v2.dart:29:31)
E/flutter ( 5639): #5 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
E/flutter ( 5639): #6 ID3V2Writer.prepareTag (package:dart_tags/src/writers/id3v2.dart:17:14)
E/flutter ( 5639): #7 Writer.write (package:dart_tags/src/writers/writer.dart:13:59)
does this library write tags to file or just parse them only, I can see this message: "/// Writer could just transform only tags in byte array" in the code.
I was wondering how easy it is to add tags to the files? Is it something on your horizon?
Thank for your amazing effort to get this library to where it is now, and it has been pretty useful thus far.
I am using this library to extract the lyrics tag from an mp3 file that contains both English and Japanese characters and encountered an issue because the first few characters were showing invalid symbols.
I have already figured out the problem and just wanted to share here how I resolved it.
The first few bytes of the lyrics tag contains the following sequence:
[101, 110, 103, 255, 254, 0, 0, 255, 254, 49, 0, 46, 0, 32, 0,...]
I figured out that to remove the invalid characters, I just need to remove the first seven bytes so that the frame will start at the 8th byte. So I modified your clearFrameData() from id3v2_frame.dart.
List<int> clearFrameData(List<int> bytes) {
var key = 0;
for (var i = 0; i < bytes.length; i++) {
if (bytes[i] == 0xFF && bytes[i + 1] == 0xFE) {
key = i;
}
}
return bytes.sublist(key);
}
From the latest release, you seem to have stopped using clearFrameData() so I am just writing this stuff here rather than create a new PR.
Hello, what kind of files are supported? Do I need to add tag ape, flac, m4a and mp3 for these music formats
Describe the bug
When parsing the MP3s in my library, the processor crashed with this stack trace:
Unhandled exception:
NoSuchMethodError: The method 'decode' was called on null.
Receiver: null
Tried calling: decode(Uint8Array)
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1 ID3V2Reader.parseValues (package:dart_tags/src/readers/id3v2.dart:71:23)
#2 Reader.read. (package:dart_tags/src/readers/reader.dart:13:23)
#3 _RootZone.runUnary (dart:async/zone.dart:1450:54)
#4 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#5 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#6 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#7 Future._addListener. (dart:async/future_impl.dart:393:9)
#8 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#9 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#10 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:120:13)
#11 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)
Environment
Expected behavior
Parses and returns tags correctly.
Describe the bug
can't find the bitrate in the tags using both versions of ID3
Environment
To Reproduce
Steps to reproduce the behavior:
Expected behavior
find a tag with the name bitrate
Additional context
i can get that with native android using the MediaMetadataRetriever
Describe the bug
Tags with Chinese/Japanese/Korean characters are not parsed and show up like "??"
Environment
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Clear parsing of the text
I used EasyTag to change Artist tag to "Полина Гагарина&Егор Крид"
But the package return it like "Полинаጠ〄㌄〄䀄㠄㴄〄☄Егорᨠ䀄㠄㐄�"
Hi, this is really a good library but is very slow.
Is there a way to speed it up?
Can you please provide an example how an APIC tag can be written?
Describe the bug
a bug when trying to get the comments out of a file after writing new tags in, that includes new comments
Environment
To Reproduce
Steps to reproduce the behavior:
execute this code :
final com1 = Comment('eng', 'desc_here', 'lol it is a comment');
final com2 = Comment('eng', 'desc_here_2', 'lol it is a comment');
final pic = AttachedPicture(
'image/jpeg', 0x03, 'foo.jpg', picture.readAsBytesSync());
final tag = Tag()
..tags = {
'title': 'foo',
'artist': 'bar',
'album': 'baz',
'year': '2010',
'comment': {
com1.key: com1,
com2.key: com2,
},
'track': '6',
'genre': 'Dream',
'custom': 'Just a tag',
// No picture used
}
..type = 'ID3'
..version = '2.4';
final writer = ID3V2Writer();
final blocks = writer.write(await file2.readAsBytes(), tag);
final r = ID3V2Reader();
final f = await r.read(blocks);
Additional context
the full error
[ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: RangeError (end): Invalid value: Not in inclusive range 12..30: -1
E/flutter (14192): #0 RangeError.checkValidRange (dart:core/errors.dart:357:9)
E/flutter (14192): #1 List.sublist (dart:core-patch/growable_array.dart:84:38)
E/flutter (14192): #2 ApicFrame.decodeBody (package:dart_tags/src/frames/id3v2/apic_frame.dart:79:25)
E/flutter (14192): #3 ID3V2Frame.decode (package:dart_tags/src/frames/id3v2/id3v2_frame.dart:57:39)
E/flutter (14192): #4 ID3V2Reader.parseValues (package:dart_tags/src/readers/id3v2.dart:71:23)
E/flutter (14192): #5 Reader.read.<anonymous closure> (package:dart_tags/src/readers/reader.dart:13:23)
E/flutter (14192): #6 _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter (14192): #7 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (14192): #8 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
E/flutter (14192): #9 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
E/flutter (14192): #10 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
E/flutter (14192): #11 Future._completeWithValue (dart:async/future_impl.dart:529:5)
E/flutter (14192): #12 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
Hi,
When I try to get album cover as a base64 string I always get wrong base64 string and can't get image from it. Especially for big size(1 mb or more) album covers. If the cover is smaller than 1 mb, I can get image from it's base64 string.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.