EndlessStreamingServiceV2 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

EndlessStreamingServiceV2.viaApiKey(String apiKey, String projectId, {String? cloudSpeechEndpoint, String? location})
Creates a EndlessStreamingServiceV2 interface using a API keys.
factory
EndlessStreamingServiceV2.viaServiceAccount(ServiceAccount account, {required String projectId, String? cloudSpeechEndpoint, String? location})
Creates a EndlessStreamingServiceV2 interface using a service account.
factory
EndlessStreamingServiceV2.viaThirdPartyAuthenticator(ThirdPartyAuthenticator thirdPartyAuthenticator, {required String projectId, String? cloudSpeechEndpoint, String? location})
Creates a EndlessStreamingServiceV2 interface using a third party authenticator. Don't worry about updating the access token, the package does it automatically. Example: final SpeechToTextV2 = SpeechToTextV2.viaThirdPartyAuthenticator( ThirdPartyAuthenticator( obtainCredentialsFromThirdParty: () async { // request api to get token final json = await requestCredentialFromMyApi(); return AccessCredentials.fromJson(json); }, ), );
factory
EndlessStreamingServiceV2.viaToken(String typeToken, String token, {required String projectId, String? cloudSpeechEndpoint, String? location})
Creates a EndlessStreamingServiceV2 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
projectId String
Your Google Project Id. This is required for Version2
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
endlessStreamingRecognize(StreamingRecognitionConfigV2 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