How can I show the process of TTS to WAV file converting in Progressbar?

Viewed 249

I am creating a TextToSpeech app. I am saving it's output in the .wav file. My code is working. Unfortunately when I convert it to a long message in the .wav file, the .wav file is saved, but when I click on it, this warning comes: "couldn't play the track that you requested"

After a short time the .wav file is played. This means, big messages take this process for converting .tts to .wav. I want to show that process in the progress bar.

Please suggest me how I can show the process of .tts to .wav file converting in Progressbar ?

This is my code:

btn1.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub
        String speakTextTxt = et.getText().toString();
        HashMap<String, String> myHashRender = new HashMap<String, String>();
        myHashRender.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, speakTextTxt);

        String exStoragePath = Environment.getExternalStorageDirectory().getAbsolutePath()+"/audio/";
        new File(exStoragePath, "example.xml");
        File appTmpPath = new File(exStoragePath);
        appTmpPath.mkdirs();
        String tempFilename = "abcd.wav";
        String tempDestFile = appTmpPath.getAbsolutePath() + "/" + tempFilename;

        tts.synthesizeToFile(speakTextTxt, myHashRender, tempDestFile);
    }
});
0 Answers
Related