Code Monkey home page Code Monkey logo

lucjosin / on_audio_edit Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 2.0 194 KB

Flutter Plugin used to edit and read audios/songs infos/tags [Mp3, OggVorbis, Wav, etc...].

Home Page: https://pub.dev/packages/on_audio_edit

License: BSD 3-Clause "New" or "Revised" License

Kotlin 62.55% Swift 0.91% Objective-C 0.70% Dart 34.98% Ruby 0.86%
audio-tag dart edit-audio flutter flutter-audio-edit flutter-id3 flutter-null-safety flutter-plugin flutter-tag jaudiotagger kotlin on-audio-edit songs-tags

on_audio_edit's Introduction

About me:

  • I’m currently working on my side project: HawAPI

  • I’m currently learning about Backend & APIs with Java + Spring Boot

  • I’m looking to collaborate on everything i can

  • I ❤️ 🦉

❝For in dreams we enter a world that is entirely our own. Let them swim in the deepest ocean or glide over the highest cloud.❞

Where to find me (@LucJosin):

Linkedin Linkedin Github Github Twitter Twitter Bluesky Bluesky StackOverFlow StackOverFlow

Latest Posts:

Spring Boot: Using the new filter for trailing slash handling
How to • Jun 13, 2024
In this tutorial, we’ll explore how to use the new UrlHandlerFilter to handle trailing slash in Spring Boot 3, including how to forward or redirect requests.
Read more ➜
Go: How to mock SCS session authentication in tests
How to • Feb 1, 2024
In this article, we'll explore how to mock our session when using SCS and inject data into context for authentication tests.
Read more ➜
How to hash class names in Astro using astro-rename integration
How to • Oct 14, 2023
Learn how to use the astro-rename integration to hash all CSS class names from your Astro project.
Read more ➜

on_audio_edit's People

Contributors

brex900 avatar lucjosin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kuama-it msob7yy

on_audio_edit's Issues

editAudio method doesn't work on Android 11.

This is what I do,

 Map<TagType, dynamic> tags = {
   TagType.TITLE: title,
   TagType.ARTIST: artist,
   TagType.GENRE: genre,
 };
 bool song = await OnAudioEdit().editAudio(data, tags);  // data = "/storage/..."
 print(song);

I give permission to the folder which contains the song and yet I get,

I/on_audio_exception(18448): java.io.FileNotFoundException: No content provider:
I/flutter (18448): false

I assumed it had to do something with newer android permissions so I tried giving the app the all_files_access but still had no luck.

Make "editAudio" method faster.

Since I am developing on android 11, when using the "editAudio" method, I call "requestComplexPermission" to specify the folder, and set searchInsideFolders to ture.

The "editAudio" method succeeds in a small test folder (whit a few song Files).
However, for large folders, it takes a very long time (about 1 minute) and the operation is unstable.
(My music library has 6500 music files, which is about 60GB in size.)

Is this the correct behavior?

Can't read flac files.

When trying to readAudio for flac files I get this error (works fine for mp3, m4a, aac),

E/MethodChannel#com.lucasjosino.on_audio_edit(12866): Failed to handle method call
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): java.lang.UnsupportedOperationException: Cover Art cannot be retrieved using this method
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): at org.jaudiotagger.tag.flac.FlacTag.getValue(FlacTag.java:253)
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): at com.lucasjosino.on_audio_edit.methods.read.OnAudioRead.readAudio(OnAudioRead.kt:29)
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): at com.lucasjosino.on_audio_edit.OnAudioEditPlugin.onMethodCall(OnAudioEditPlugin.kt:122)
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:84)
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:865)
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): at android.os.MessageQueue.next(MessageQueue.java:335)
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): at android.os.Looper.loop(Looper.java:183)
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): at android.app.ActivityThread.main(ActivityThread.java:7670)
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594)
E/MethodChannel#com.lucasjosino.on_audio_edit(12866): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:943)
E/flutter (12866): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(error, Cover Art cannot be retrieved using this method, null, java.lang.UnsupportedOperationException: Cover Art cannot be retrieved using this method
E/flutter (12866): at org.jaudiotagger.tag.flac.FlacTag.getValue(FlacTag.java:253)
E/flutter (12866): at com.lucasjosino.on_audio_edit.methods.read.OnAudioRead.readAudio(OnAudioRead.kt:29)
E/flutter (12866): at com.lucasjosino.on_audio_edit.OnAudioEditPlugin.onMethodCall(OnAudioEditPlugin.kt:122)
E/flutter (12866): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/flutter (12866): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:84)
E/flutter (12866): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:865)
E/flutter (12866): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (12866): at android.os.MessageQueue.next(MessageQueue.java:335)
E/flutter (12866): at android.os.Looper.loop(Looper.java:183)
E/flutter (12866): at android.app.ActivityThread.main(ActivityThread.java:7670)
E/flutter (12866): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (12866): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594)
E/flutter (12866): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:943)
E/flutter (12866): )
E/flutter (12866): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter (12866): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
E/flutter (12866):
E/flutter (12866): #2 OnAudioEdit.readAudio (package:on_audio_edit/details/on_audio_edit_controller.dart:60:33)
E/flutter (12866):

Wrong value return

part of on_audio_edit;

/// [AudioModel] contains all Song Tag/Information.
class AudioModel {
AudioModel(this._info);
String? get year => _info["YEAR"];}
year isn't string

On_audio_edit deprecated

Hello, when I start the debugging of my app I get the following error:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':on_audio_edit' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32

Can't read audio without artworks

Whenever trying to readAudio for files without artworks, I get this error:

E/MethodChannel#com.lucasjosino.on_audio_edit(16951): java.lang.NullPointerException: Attempt to invoke interface method 'byte[] org.jaudiotagger.tag.images.Artwork.getBinaryData()' on a null object reference
E/MethodChannel#com.lucasjosino.on_audio_edit(16951): at com.lucasjosino.on_audio_edit.utils.OnExtraInfoKt.checkAndGetExtraInfo(OnExtraInfo.kt:14)
E/MethodChannel#com.lucasjosino.on_audio_edit(16951): at com.lucasjosino.on_audio_edit.methods.read.OnAudioRead.readAudio(OnAudioRead.kt:36)
E/MethodChannel#com.lucasjosino.on_audio_edit(16951): at com.lucasjosino.on_audio_edit.OnAudioEditPlugin.onMethodCall(OnAudioEditPlugin.kt:122)
E/MethodChannel#com.lucasjosino.on_audio_edit(16951): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#com.lucasjosino.on_audio_edit(16951): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:84)
E/MethodChannel#com.lucasjosino.on_audio_edit(16951): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:865)
E/MethodChannel#com.lucasjosino.on_audio_edit(16951): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#com.lucasjosino.on_audio_edit(16951): at android.os.MessageQueue.next(MessageQueue.java:335)
E/MethodChannel#com.lucasjosino.on_audio_edit(16951): at android.os.Looper.loop(Looper.java:183)
E/MethodChannel#com.lucasjosino.on_audio_edit(16951): at android.app.ActivityThread.main(ActivityThread.java:7670)
E/MethodChannel#com.lucasjosino.on_audio_edit(16951): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#com.lucasjosino.on_audio_edit(16951): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594)
E/MethodChannel#com.lucasjosino.on_audio_edit(16951): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:943)

Can't read and edit the song album name

I've been trying to read a song album name but the name doesn't come up and also I've tried to edit but it doesn't change. I'm using the TagType.ORIGINAL_ALBUM.

Retrieve the path where permission is given

It would be cool if there was on option to retrieve the path where the user gave the permission("/storage/..."), so it'd be easy to reset and again get permission if the user wants to edit a song in a different location.

Support input Uint8List to edit artwork

Please add a method that can edit artwork with Uint8List as input.
Currently, it is necessary to acquire an image from the Internet and save it as a file once when editing the artwork.
This is inconvenient because it interferes with file access restrictions.
I'm sorry if I'm new to GitHub and make a mistake.
Thank you.

EditArtwork does not work with ImagePath

Hi, It's been a long time!
EditArtwork function does not work with image path(it does work with FilePicker).

E/AndroidRuntime(26913): FATAL EXCEPTION: main
E/AndroidRuntime(26913): Process: com.Phoenix.project, PID: 26913
E/AndroidRuntime(26913): java.io.FileNotFoundException: : open failed: ENOENT (No such file or directory)
E/AndroidRuntime(26913):        at libcore.io.IoBridge.open(IoBridge.java:575)
E/AndroidRuntime(26913):        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:289)
E/AndroidRuntime(26913):        at org.jaudiotagger.tag.images.AndroidArtwork.setFromFile(AndroidArtwork.java:123)
E/AndroidRuntime(26913):        at org.jaudiotagger.tag.images.AndroidArtwork.createArtworkFromFile(AndroidArtwork.java:144)
E/AndroidRuntime(26913):        at org.jaudiotagger.tag.images.ArtworkFactory.createArtworkFromFile(ArtworkFactory.java:40)
E/AndroidRuntime(26913):        at com.lucasjosino.on_audio_edit.methods.edits.OnArtworkEdit10$doEverythingInBackground$2.invokeSuspend(OnArtworkEdit10.kt:122)
E/AndroidRuntime(26913):        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
E/AndroidRuntime(26913):        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
E/AndroidRuntime(26913):        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
E/AndroidRuntime(26913):        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
E/AndroidRuntime(26913):        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
E/AndroidRuntime(26913):        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
E/AndroidRuntime(26913): Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
E/AndroidRuntime(26913):        at libcore.io.Linux.open(Native Method)
E/AndroidRuntime(26913):        at libcore.io.ForwardingOs.open(ForwardingOs.java:567)
E/AndroidRuntime(26913):        at libcore.io.BlockGuardOs.open(BlockGuardOs.java:273)
E/AndroidRuntime(26913):        at libcore.io.ForwardingOs.open(ForwardingOs.java:567)
E/AndroidRuntime(26913):        at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7725)
E/AndroidRuntime(26913):        at libcore.io.IoBridge.open(IoBridge.java:561)
E/AndroidRuntime(26913):        ... 11 more
I/Process (26913): Sending signal. PID: 26913 SIG: 9
Lost connection to device.

This was the same case for both android 12 and android 9, except android 12 crashed completely but android 9 didn't.

I tried to dig through your code and found the issue.

What does findImage() do?
I tried passing the uri directly without findImage() like below and it worked on both android versions,

        val imageData = File(uri.toString())

Release build fails

When doing flutter run --release I get this,

C:\Users\shaan.gradle\caches\transforms-2\files-2.1\4cd90c1b3c810f286bcda54e8bc9232f\jetified-jaudiotagger-2.2.3-runtime.jar: R8: Type org.jaudiotagger.FileConstants is defined multiple times: C:\Users\shaan.gradle\caches\transforms-2\files-2.1\4cd90c1b3c810f286bcda54e8bc9232f\jetified-jaudiotagger-2.2.3-runtime.jar:org/jaudiotagger/FileConstants.class, D:\Flutter\FLUTTER\Phoenix\build\audiotagger\intermediates\runtime_library_classes_jar\release\classes.jar:org/jaudiotagger/FileConstants.class

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:minifyReleaseWithR8'.

com.android.tools.r8.CompilationFailedException: Compilation failed to complete

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 13s
Running Gradle task 'assembleRelease'... 76.5s
[!] The shrinker may have failed to optimize the Java bytecode.
To disable the shrinker, pass the --no-shrink flag to this command.
To learn more, see: https://developer.android.com/studio/build/shrink-code
Exception: Gradle task assembleRelease failed with exit code 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.