synthesizeToFile() is creating an empty audio file
💬 Questions and Help
Provide question related to this flutter plugin.
I am working on an application in which user enters a script and then generate an audio file from that but the issue I am facing is synthesizeToFile() function is generating an empty audio file if the entered script is more than 1 lines. Also I am saving the generated audio file into firebase storage and the audio files are not getting played if it is generated successfully.
I have tried await _tts.awaitSpeakCompletion(true) but it also did not help.
@AyeshaIftikhar does it work with await flutterTts.awaitSynthCompletion(true); ? I'm not sure what you mean by having a user enter a "script" and then generate an audio file from it.
@AyeshaIftikhar does it work with
await flutterTts.awaitSynthCompletion(true);? I'm not sure what you mean by having a user enter a "script" and then generate an audio file from it.
I am doing this await and even though I haven't used flutterTts.speak() but still it utters the script in the background and that's why it is generating the empty audio file.
@AyeshaIftikhar by "script" do you mean "text" that a user passed to the function? Can you provide an example showing the issue you're running into so I can try to replicate it?
@dlutton I can't share the complete code because there are too much variable and steps included and the code is the property of the company I work for and they don't allow to share the code publicily but I can share the process. And the process is:
- User creates the script by typing some test or selecting some of the options provided by the application.
- Then they will generated the audio script.
- Now the issue I am facing is that according to the documentation audio files being generated for android are with .wav extension. Firstly, the .wav files are not played by any of the audio playing packages. Second, As I have to save that generated audio file on Firebase Storage then I am facing the issue while creating the audio from text. I am not using
speak()function but somehow it stills utters the text that are being generated but without speaking it out loud which isn't a problem for the text that is just a few words long but when the text is like one paragraph or so the the generated audio file is of 0 bytes in size which as we know is empty.
It will be very helpful if you can give me any kind of solution or suggestion for resolving this issue. Thanks.
@AyeshaIftikhar is the issue with the length of the text you're passing into the method? Do you know how many characters are being passed in?
@AyeshaIftikhar is the issue with the length of the text you're passing into the method? Do you know how many characters are being passed in?
I can't say it exactly but the text entered by the user can be of any length. I would say it can go up to 1000 to 10,000 characters in length.
@AyeshaIftikhar is the issue with the length of the text you're passing into the method? Do you know how many characters are being passed in?
I can't say it exactly but the text entered by the user can be of any length. I would say it can go up to 1000 to 10,000 characters in length.
I have also this issue of creating empty file with zero size . have you solved it?
@Amankhan-mobipixels is this occurring on iOS or Android or both? Also, what's the filename and extension you're giving it?
@AyeshaIftikhar is the issue with the length of the text you're passing into the method? Do you know how many characters are being passed in?
I can't say it exactly but the text entered by the user can be of any length. I would say it can go up to 1000 to 10,000 characters in length.
I have also this issue of creating empty file with zero size . have you solved it?
It just don't work no matter what approach do you do. So I just switch to Azure Tts
@AyeshaIftikhar is the issue with the length of the text you're passing into the method? Do you know how many characters are being passed in?
I can't say it exactly but the text entered by the user can be of any length. I would say it can go up to 1000 to 10,000 characters in length.
I have also this issue of creating empty file with zero size . have you solved it?
It just don't work no matter what approach do you do. So I just switch to Azure Tts
@AyeshaIftikhar is the issue with the length of the text you're passing into the method? Do you know how many characters are being passed in?
I can't say it exactly but the text entered by the user can be of any length. I would say it can go up to 1000 to 10,000 characters in length.
I have also this issue of creating empty file with zero size . have you solved it?
It just don't work no matter what approach do you do. So I just switch to Azure Tts
Its work fine now with tts after some changes in code thank you all of you for your reply and help
Hi I have the same issue! What did you do to your code for it to start working?
It really never worked properly for my particular scenerio.
On Sat, Mar 18, 2023, 11:01 PM anonna16 @.***> wrote:
Hi I have the same issue! What did you do to your code for it to start working?
— Reply to this email directly, view it on GitHub https://github.com/dlutton/flutter_tts/issues/312#issuecomment-1474933123, or unsubscribe https://github.com/notifications/unsubscribe-auth/APDNEYUF3UIUNOMMATRHHGDW4XZ53ANCNFSM5PUBLERQ . You are receiving this because you were mentioned.Message ID: @.***>
@Amankhan-mobipixels Can you please share what changes you did in your code?
await flutterTts.awaitSynthCompletion(true); this can help