create Tts Sync Media Timeline
Creates a new TTS SyncMediaTimeline from the specified list of ReaderDocuments. The resulting SyncMediaTimeline can be played using a SyncMediaPlayer.
When creating a TTS SyncMediaTimeline, you must specify:
A TTS Synthesizer used for speaking the text contents.
A ReaderViewAnnotationLayer used for highlighting the currently spoken text.
TtsSynthesizer
The TtsSynthesizer is responsible for synthesizing text fragments into audio and play it. This framework provides ColibrioTtsSynthesizer which uses android.speech.tts.TextToSpeech.
Highlighting
When playing the timeline, the passed ReaderViewAnnotationLayer will be used to create ReaderViewAnnotation instances for highlighting the current spoken text.
Use TtsSyncMediaTimelineConfiguration.rendererOptions to configure how the highlights should be styled. If no options are specified, the options set using ReaderViewAnnotationLayer.defaultAnnotationOptions will be used.
WARNING: If you don't specify any range styles using TtsSyncMediaTimelineConfiguration.rendererOptions or ReaderViewAnnotationLayer.defaultAnnotationOptions, highlights will be transparent!
Checking if publication supports TTS
You can check if this publication supports TTS by checking if availableSyncMediaFormats contains SyncMediaFormat.CONTENT_BLOCK_TTS.
Parameters
The reader documents that should be part of the timeline.
The TTS SyncMediaTimeline configuration.
Called when the SyncMediaTimeline has been created successfully.
Called if there was an error creating the timeline.
A function called several times indicating the create progress as a value between 0 and 1.
Creates a new TTS SyncMediaTimeline from the specified list of ReaderDocuments. The resulting SyncMediaTimeline can be played using a SyncMediaPlayer.
When creating a TTS SyncMediaTimeline, you must specify:
A TTS Synthesizer used for speaking the text contents.
A ReaderViewAnnotationLayer used for highlighting the currently spoken text.
TtsSynthesizer
The TtsSynthesizer is responsible for synthesizing text fragments into audio and play it. This framework provides ColibrioTtsSynthesizer which uses android.speech.tts.TextToSpeech.
Highlighting
When playing the timeline, the passed ReaderViewAnnotationLayer will be used to create ReaderViewAnnotation instances for highlighting the current spoken text.
Use TtsSyncMediaTimelineConfiguration.rendererOptions to configure how the highlights should be styled. If no options are specified, the options set using ReaderViewAnnotationLayer.defaultAnnotationOptions will be used.
WARNING: If you don't specify any range styles using TtsSyncMediaTimelineConfiguration.rendererOptions or ReaderViewAnnotationLayer.defaultAnnotationOptions, highlights will be transparent!
Checking if publication supports TTS
You can check if this publication supports TTS by checking if availableSyncMediaFormats contains SyncMediaFormat.CONTENT_BLOCK_TTS.
Return
Either ColibrioResult.Success with the created SyncMediaTimeline if the operation is successful, or ColibrioResult.Error if an error occurred while creating the timeline.
Parameters
The reader documents that should be part of the timeline.
The TTS SyncMediaTimeline configuration.
A function called several times indicating the create progress as a value between 0 and 1.