flutter_tts icon indicating copy to clipboard operation
flutter_tts copied to clipboard

synthesizeToFile Saving to External Storage

Open drexhacker opened this issue 9 months ago • 5 comments

🐛 Bug Report

Hello I think the program should save the generated audio to the given path because each app has different use case and for my case I use Application Support Directory because I only generate tts for copyrighted content which should only be accessible via the app not externally. Here is an example filePath

I also saw similar issues where this same case was resolved in the previous versions.

  • Before
/data/user/0/com.hsecampus.app/files/uploads/authors/Henry_Dominion_Kyabire/FIRE_SAFETY_EDUCATION_FOR_SCHOOL_LEARNERS/audio/page_109.mp3
  • After
/external/audio/media/658//data/user/0/com.hsecampus.app/files/uploads/authors/Henry_Dominion_Kyabire/FIRE_SAFETY_EDUCATION_FOR_SCHOOL_LEARNERS/audio/page_108.mp3

Expected behavior

Save to Given Path

Reproduction steps

Just Call synthesizeToFile with a full path

Configuration

No Configuration Changed am just calling the method as it is and supplying the text along side the destination filepath.

Version: 4.0.2

Platform:

  • [ ] :iphone: iOS
  • [x] :robot: Android

drexhacker avatar May 07 '24 17:05 drexhacker

I have Temporarily reverted to flutter_tts: ^3.8.5 which includes the support to save to a given path, as am waiting for any update on this. Thank You for the Wonderful work

drexhacker avatar May 08 '24 07:05 drexhacker

Please check this PR, I added a flag to handler custom paths

https://github.com/dlutton/flutter_tts/pull/509

j-ixcayau avatar Jul 04 '24 04:07 j-ixcayau

Same issue

yunchiri avatar Jul 08 '24 04:07 yunchiri

Please check this PR, I added a flag to handler custom paths

#509

This is a must have PR that should be merged as soon as possible since the base behavior has been broken fom 4.0.0 (and older) to 4.0.1 with this commit : https://github.com/dlutton/flutter_tts/commit/3cb449d69238f478fe4635ad3a195c10d55b7a5b :(

If you have this issue and this pull request is not merged, you should use version 4.0.0 of the plugin in your app :

flutter_tts: 4.0.0

I've seen this just before updating my app and plugin version... Most users using this plugin will have their base behavior broken when upgrading the plugin version because of the change of behavior of synthesizeToFile method not allowing full path by default...

QuentinCG avatar Jul 28 '24 15:07 QuentinCG

Please check this PR, I added a flag to handler custom paths

#509

Thanks for that. I will definitely check it out.

drexhacker avatar Aug 15 '24 02:08 drexhacker