Example usage for android.speech.tts TextToSpeech synthesizeToFile

List of usage examples for android.speech.tts TextToSpeech synthesizeToFile

Introduction

In this page you can find the example usage for android.speech.tts TextToSpeech synthesizeToFile.

Prototype

@Deprecated
public int synthesizeToFile(final String text, final HashMap<String, String> params, final String filename) 

Source Link

Document

Synthesizes the given text to a file using the specified parameters.

Usage

From source file:ca.rmen.android.poetassistant.PoemAudioExport.java

private void speakToFile4(TextToSpeech textToSpeech, String text, File audioFile) {
    HashMap<String, String> params = new HashMap<>();
    params.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, TEMP_AUDIO_FILE);
    //noinspection deprecation
    textToSpeech.synthesizeToFile(text, params, audioFile.getAbsolutePath());
}