dlutton/flutter_tts

synthesizeToFile Issue: type 'int' is not a subtype of type 'String'

theatifwaheed opened this issue · 3 comments

The file is saved but it throws on the synthesizeToFile call but saves the file as well.

Screenshot 2024-04-20 at 10 51 52 PM

@dlutton Will you please help me in fixing this issue?

Same issue here. It seems that the synthesizeToFile function only returns 0 or 1 but not the created file's path. @theatifwaheed, you probably awaited the dynamic type (that is int) as String.
I tried to guess the path based on this SO question but since Android R and up is using the content provider there no way to guess the file path.
I did not find any way to get the file's path, and based on the Android implementation, it is never returned, just logged.
In this form, the synthesizeToFile function is useless on Android. Is there any chance that this will be fixed?
It would be nice to get the file path as the result, at least when the tts.awaitSynthCompletion(true) is set.

@dlutton @vkrissz apologies for the inconvenience.
I received String (somehow) for once in the synthesizeToFile Function but then I received an integer 0 or 1 and I got confused about that.

The issue was resolved as I have a fork of the repo. I simply returned the path of file on completion.

Thanks for replying and waiting for a long time for my response.

Closing The Issue.