google_speech
5.3.0, released 2 years ago by felixjunghans.de
Flutter plugin for the Google Cloud gRPC Speech-to-Text API.
What it does
Allows Flutter apps to communicate with the Google Cloud Speech-to-Text API using gRPC. It supports audio transcription via file recognition, real-time streaming recognition, and endless stream support.
AI-written summary of version 5.3.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to transcribe audio files to text using Google Cloud Speech-to-Text in a Flutter app.
- You require real-time streaming audio transcription or endless stream support.
Skip it when
- You need local, on-device speech-to-text processing without a cloud backend.
- You cannot configure Google Cloud credentials, service accounts, or tokens.
Strengths
- Pure Dart implementation utilizing gRPC for streaming transcription support.
- Supports multiple authentication methods including service accounts, tokens, and third-party authenticators.
- Supports Google Speech V1, Beta, and V2 APIs.
Weaknesses
- Requires an active Google Cloud account and properly configured credentials.
- Streaming audio quality issues or incorrect formats can lead to empty API responses.
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 8
Requires creating a Google Cloud account, activating the Speech API, generating a service account JSON file, and configuring permissions/credentials in the app.
import 'package:google_speech/speech_client_authenticator.dart';
final serviceAccount = ServiceAccount.fromString(r'''{YOUR_JSON_STRING}''');
final speechToText = SpeechToText.viaServiceAccount(serviceAccount);
final config = RecognitionConfig(
encoding: AudioEncoding.LINEAR16,
sampleRateHertz: 16000,
languageCode: 'en-US'
);
final response = await speechToText.recognize(config, audioBytes);Works with
Packages commonly used together with google_speech: ones it builds on, ones built on it, and its own family.
- fixnumgoogle_speech depends on itProvides 32‑ and 64‑bit signed fixed‑width integer types for Dart.
- path_providergoogle_speech depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- rxdartgoogle_speech depends on itImplementation of the ReactiveX API for asynchronous programming leveraging native Dart Streams.
- protobufgoogle_speech depends on itProvides runtime support for Dart protocol buffer messages generated by protoc_plugin.
- googleapis_authgoogle_speech depends on itObtain Access credentials and authenticated HTTP clients for Google APIs using OAuth 2.0.
- grpcgoogle_speech depends on itDart implementation of gRPC, a high performance universal RPC framework.