Samurai016/Audiotagger

Error Trying To Write MetaData

Closed this issue · 2 comments

I am currently recording a live stream and writing it to a file in flutter using a byte array. I am doing this by reading the live stream as a stream and then writing it to a file using File.openWrite and all is going well however I just realized I need to write some metadata to the file. I tried doing the writeTag() but I keep running into this error:

However, I keep running into this error and have no idea how to fix this. Checking further because the ID3 Tag ends at 0x00 but the mp3 audio doesn't start until 0x129

This is also part of the error:

W/System.err(20398): java.lang.NullPointerException: Attempt to invoke interface method 'void org.jaudiotagger.tag.Tag.setField(org.jaudiotagger.tag.FieldKey, java.lang.String[])' on a null object reference
W/System.err(20398):    at com.nicolorebaioli.audiotagger.AudiotaggerPlugin$Util.setFieldIfExist(AudiotaggerPlugin.java:222)
W/System.err(20398):    at com.nicolorebaioli.audiotagger.AudiotaggerPlugin.writeTags(AudiotaggerPlugin.java:92)
W/System.err(20398):    at com.nicolorebaioli.audiotagger.AudiotaggerPlugin.onMethodCall(AudiotaggerPlugin.java:64)
W/System.err(20398):    at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
W/System.err(20398):    at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
W/System.err(20398):    at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
W/System.err(20398):    at android.os.MessageQueue.nativePollOnce(Native Method)
W/System.err(20398):    at android.os.MessageQueue.next(MessageQueue.java:326)
W/System.err(20398):    at android.os.Looper.loop(Looper.java:160)

Keep in mind this file that is being created has no metadata of any kind because it is a file that is created using the method described above. Hope to hear from someone soon!! Thank you in advance!

I think the problem might be the file structure, especially the MP3 header.
As I suggested in issue #7 , I would recommend you to:

  • Convert the file to mp3 using flutter_ffmpeg
  • Write tags using Audiotagger

Find the command to execute here.
Let me know if it works!

I think the problem might be the file structure, especially the MP3 header.
As I suggested in issue #7 , I would recommend you to:

  • Convert the file to mp3 using flutter_ffmpeg
  • Write tags using Audiotagger

Find the command to execute here.
Let me know if it works!

Looks Like that did it thank you so much for steering me in the right direction! I will close this issue now! Once again thank you!