Methods Summary |
---|
public int | audioAvailable(byte[] buffer, int offset, int length)The service should call this method when synthesized audio is ready for consumption.
This method should only be called on the synthesis thread,
while in {@link TextToSpeechService#onSynthesizeText}.
|
public int | done()The service should call this method when all the synthesized audio for a request has
been passed to {@link #audioAvailable}.
This method should only be called on the synthesis thread,
while in {@link TextToSpeechService#onSynthesizeText}.
This method has to be called if {@link #start} and/or {@link #error} was called.
|
public void | error()The service should call this method if the speech synthesis fails.
This method should only be called on the synthesis thread,
while in {@link TextToSpeechService#onSynthesizeText}.
|
public void | error(int errorCode)The service should call this method if the speech synthesis fails.
This method should only be called on the synthesis thread,
while in {@link TextToSpeechService#onSynthesizeText}.
|
public int | getMaxBufferSize()
|
public boolean | hasFinished()Check if {@link #done} was called or not.
This method should only be called on the synthesis thread,
while in {@link TextToSpeechService#onSynthesizeText}.
Useful for checking if a fallback from network request is possible.
|
public boolean | hasStarted()Check if {@link #start} was called or not.
This method should only be called on the synthesis thread,
while in {@link TextToSpeechService#onSynthesizeText}.
Useful for checking if a fallback from network request is possible.
|
public int | start(int sampleRateInHz, int audioFormat, int channelCount)The service should call this when it starts to synthesize audio for this
request.
This method should only be called on the synthesis thread,
while in {@link TextToSpeechService#onSynthesizeText}.
|