getAudio method
Future<TextToSpeechResponse>
getAudio(
- String text, {
- TextToSpeechOptions? options,
- CancellationToken? cancellationToken,
override
Synthesizes text into audio and returns the complete response.
Implementation
@override
Future<TextToSpeechResponse> getAudio(
String text, {
TextToSpeechOptions? options,
CancellationToken? cancellationToken,
}) async {
developer.Timeline.startSync(
OpenTelemetryConsts.textToSpeechSpanName,
arguments: _buildArguments(options),
);
try {
final result = await super.getAudio(
text,
options: options,
cancellationToken: cancellationToken,
);
developer.Timeline.finishSync();
return result;
} catch (e) {
developer.Timeline.finishSync();
rethrow;
}
}