EndlessStreamingService class

An interface to Google's Speech-to-Text Api via grpc for endless streaming recognize.

Important! You need an own Google project to use this class.

Constructors

EndlessStreamingService.viaApiKey(String apiKey, {String? cloudSpeechEndpoint})
Creates a EndlessStreamingService interface using a API keys.
factory
EndlessStreamingService.viaServiceAccount(ServiceAccount account, {String? cloudSpeechEndpoint})
Creates a EndlessStreamingService interface using a service account.
factory
EndlessStreamingService.viaThirdPartyAuthenticator(ThirdPartyAuthenticator thirdPartyAuthenticator, {String? cloudSpeechEndpoint})
Creates a EndlessStreamingService interface using a third party authenticator. Don't worry about updating the access token, the package does it automatically. Example: final EndlessStreamingService = EndlessStreamingService.viaThirdPartyAuthenticator( ThirdPartyAuthenticator( obtainCredentialsFromThirdParty: () async { // request api to get token final json = await requestCredentialFromMyApi(); return AccessCredentials.fromJson(json); }, ), );
factory
EndlessStreamingService.viaToken(String typeToken, String token, {String? cloudSpeechEndpoint})
Creates a EndlessStreamingService interface using a token. You are responsible for updating the token when it expires.
factory

Properties

endlessStream Stream<StreamingRecognizeResponse>
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
endlessStreamingRecognize(StreamingRecognitionConfig config, Stream<List<int>> audioStream, {Duration restartTime = const Duration(minutes: 1), Duration transitionBufferTime = const Duration(seconds: 2)}) → void
Sends a StreamingRecognizeRequest to the Google Speech Api. Requires a StreamingRecognitionConfig and an audioStream.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited