mayurpitroda96 / easy_audio_trimmer

This is a Flutter package that allows you to easily trim audio files within your Flutter app.
MIT License
11 stars 27 forks source link

It would be great if it could support custom output paths #10

Closed TheWash7 closed 9 months ago

TheWash7 commented 9 months ago

I don't understand what this callback function onSave does. I just want to customize an output path after trim.

mayurpitroda96 commented 9 months ago

You have to move or copy the file after trim successfully with your output path.

await file(input_path).rename(output_path)

https://www.appsloveworld.com/flutter/100/6/flutter-how-to-move-file

TheWash7 commented 9 months ago

Thank you for your answer. I encountered a new problem。

I use wav format files for editing, but cannot save them. The error code is as follows。

I/flutter (24225): /storage/emulated/0/Android/data/com.example.flutter_keyboarddata/files/recording.wav I/flutter (24225): 5121.0 I/flutter (24225): 6121.0 I/flutter (24225): DateTime: Dec 16, 2023 13:45:02 I/flutter (24225): Formatted: Dec16,2023_13:45:02 I/flutter (24225): Exists I/flutter (24225): Retrieved Trimmer folder I/flutter (24225): Start: 0:00:05.121000 & End: 0:00:06.121000 I/flutter (24225): /data/user/0/com.example.flutter_keyboard_data/app_flutter/Trimmer/ I/flutter (24225): OUTPUT: .mp3 V/MediaPlayer(24225): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false V/MediaPlayer(24225): cleanDrmObj: mDrmObj=null mDrmSessionId=null I/flutter (24225): Loading ffmpeg-kit-flutter. D/ffmpeg-kit-flutter(24225): FFmpegKitFlutterPlugin com.arthenica.ffmpegkit.flutter.FFmpegKitFlutterPlugin@38ade6b started listening to events on io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler$EventSinkImplementation@97bf0cc. I/flutter (24225): Loaded ffmpeg-kit-flutter-android-https-x86_64-6.0.3. I/flutter (24225): FFmpeg process exited with state COMPLETED and rc 1 I/flutter (24225): FFmpeg processing failed. I/flutter (24225): Couldn't save the audio I/flutter (24225): 处理完成,原输出路径为:null I/flutter (24225): 处理完成,自定义为:null Application finished.

TheWash7 commented 9 months ago

Is it a storage problem caused by the file name?

mayurpitroda96 commented 9 months ago

did you add the permission for storage read and write?

https://medium.com/app-dev-community/android-storage-use-cases-how-to-read-write-on-internal-storage-42df965ef516

TheWash7 commented 9 months ago

I think I have read and write permissions, because my wav file is saved locally through flutter_record, and then trimmed using trimmer。