public interface TtsListener
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
onError(String utteranceId,
String errorMessage) |
Called when an error occurs during audio synthesis or speaking.
|
void |
onEvent(int eventType,
PacMap pacMap) |
Called when a TTS event occurs.
|
void |
onFinish(String utteranceId) |
Called when audio synthesis is finished.
|
void |
onProgress(String utteranceId,
byte[] audioData,
int progress) |
Called when the audio synthesis progress changes.
|
void |
onSpeechFinish(String utteranceId) |
Called when audio speaking is finished.
|
void |
onSpeechProgressChanged(String utteranceId,
int progress) |
Called when the audio speaking progress changes.
|
void |
onSpeechStart(String utteranceId) |
Called when audio speaking starts.
|
void |
onStart(String utteranceId) |
Called when audio synthesis starts.
|
void onStart(String utteranceId)
utteranceId - Uniquely identifies the TTS request.void onProgress(String utteranceId, byte[] audioData, int progress)
The progress indicator is incremented by 1 each time an audio frame is synthesized.
utteranceId - Uniquely identifies the TTS request.audioData - Indicates the audio byte stream.progress - Indicates the audio synthesis progress.void onFinish(String utteranceId)
utteranceId - Uniquely identifies the TTS request.void onError(String utteranceId, String errorMessage)
utteranceId - Uniquely identifies the TTS request.errorMessage - Indicates the error message, for example, the speaking fails due to no initialization or the
text is empty.void onEvent(int eventType,
PacMap pacMap)
eventType - Indicates the event type. Available event types are defined in
TtsEvent.pacMap - Indicates a parcel map containing the method ID.void onSpeechStart(String utteranceId)
utteranceId - Uniquely identifies the TTS request.void onSpeechProgressChanged(String utteranceId, int progress)
utteranceId - Uniquely identifies the TTS request.progress - Indicates the audio speaking progress.void onSpeechFinish(String utteranceId)
utteranceId - Uniquely identifies the TTS request.