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

public int synthesizeToFile(final CharSequence text, final Bundle params, final File file,
        final String utteranceId) 

Source Link

Document

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

Usage

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

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void speakToFile21(TextToSpeech textToSpeech, String text, File audioFile) {
    Bundle params = new Bundle();
    textToSpeech.synthesizeToFile(text, params, audioFile, TEMP_AUDIO_FILE);
}