getStreamingAudio method
Stream<TextToSpeechResponseUpdate>
getStreamingAudio(
- String text, {
- TextToSpeechOptions? options,
- CancellationToken? cancellationToken,
override
Synthesizes text into audio and returns a stream of response updates.
Implementation
@override
Stream<TextToSpeechResponseUpdate> getStreamingAudio(
String text, {
TextToSpeechOptions? options,
CancellationToken? cancellationToken,
}) async* {
developer.Timeline.startSync(
'${OpenTelemetryConsts.textToSpeechSpanName}.streaming',
arguments: _buildArguments(options),
);
try {
yield* super.getStreamingAudio(
text,
options: options,
cancellationToken: cancellationToken,
);
developer.Timeline.finishSync();
} catch (e) {
developer.Timeline.finishSync();
rethrow;
}
}