SpeechToTextV2 class

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

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

Constructors

SpeechToTextV2.viaApiKey(String apiKey, String projectId, {String? cloudSpeechEndpoint, Map<String, String>? metadata})
Creates a SpeechToText interface using a API keys.
factory
SpeechToTextV2.viaServiceAccount(ServiceAccount account, {required String projectId, String? cloudSpeechEndpoint, Map<String, String>? metadata})
Creates a SpeechToTextV2 interface using a service account.
factory
SpeechToTextV2.viaThirdPartyAuthenticator(ThirdPartyAuthenticator thirdPartyAuthenticator, {required String projectId, String? cloudSpeechEndpoint, Map<String, String>? metadata})
Creates a SpeechToTextV2 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
SpeechToTextV2.viaToken(String typeToken, String token, {required String projectId, String? cloudSpeechEndpoint, Map<String, String>? metadata})
Creates a SpeechToTextV2 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
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
longRunningRecognize(RecognitionConfigV2 config, String audioGcsUri, {String location = 'global'}) → 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(RecognitionConfigV2 config, String audioGcsUri, {Duration pollInterval = const Duration(seconds: 1), String location = 'global'}) → Future<LongRunningRequestResult>
Sends a LongRunningRecognizeRequest request to the Google Speech Api. Requires a RecognitionConfigV2 and an RecognitionAudio.
recognize(RecognitionConfigV2 config, List<int> audio, {String location = 'global'}) → Future<RecognizeResponse>
Sends a RecognizeRequest request to the Google Speech Api. Requires a RecognitionConfig and an RecognitionAudio.
streamingRecognize(StreamingRecognitionConfigV2 config, Stream<List<int>> audioStream, {String location = 'global'}) → 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