SpeechToTextBeta class

An interface to Google's Speech-to-Text Api via grpc.

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

Constructors

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

Properties

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
longRunningRecognize(RecognitionConfigBeta config, String audioGcsUri) → ResponseFuture<Operation>
Sends a LongRunningRecognizeRequest request to the Google Speech Api. Requires a RecognitionConfigBeta and an RecognitionAudio.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pollingLongRunningRecognize(RecognitionConfigBeta config, String audioGcsUri, {Duration pollInterval = const Duration(seconds: 1)}) Future<LongRunningRequestResult>
recognize(RecognitionConfigBeta config, List<int> audio) Future<RecognizeResponse>
Sends a RecognizeRequest request to the Google Speech Api. Requires a RecognitionConfig and an RecognitionAudio.
streamingRecognize(StreamingRecognitionConfigBeta config, Stream<List<int>> audioStream) Stream<StreamingRecognizeResponse>
Sends a StreamingRecognizeRequest to the Google Speech Api. Requires a StreamingRecognitionConfig and an audioStream.
toString() String
A string representation of this object.
inherited

Operators

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