सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
Deepgram के बोलने-से-टेक्स्ट और टेक्स्ट-से-बोलने API के लिए एक Dart और Flutter क्लाइंट, जो Android, iOS, Web, macOS, Windows और Linux पर रियल-टाइम और बैच ट्रांसक्रिप्शन सक्षम करता है। इसमें स्ट्रीमिंग ऑडियो इनपुट, कस्टमाइज़ेबल ट्रांसक्रिप्शन सेटिंग्स और वॉइस असिस्टेंट के साथ इंटीग्रेशन का समर्थन है। यह पैकेज क्रॉस-प्लेटफॉर्म एप्लिकेशन में उन्नत बोलने की पहचान और सिंथेसिस फीचर्स तक पहुंच को सरल बनाता है।
उपयोग
रियल-टाइम ऑडियो ट्रांसक्रिप्शन
वॉइस असिस्टेंट इंटीग्रेशन
रिकॉर्ड की गई ऑडियो का ट्रांसक्रिप्शन
बहुभाषी बोलने का प्रसंस्करण
लाइव कैप्शनिंग
ऑडियो सामग्री इंडेक्सिंग
मुख्य विशेषताएँ
क्रॉस-प्लेटफ़ॉर्म समर्थन
स्ट्रीमिंग ऑडियो ट्रांसक्रिप्शन
कस्टमाइज़ेबल ट्रांसक्रिप्शन पैरामीटर्स
Deepgram के AI मॉडल्स के साथ एकीकरण
बहुभाषी समर्थन
टेक्स्ट-टू-स्पीच क्षमताएं
इनके लिए उपयुक्त
वॉइस-एनेबल्ड ऐप्स बनाने वाले डेवलपर्स
सटीक बोली पहचान की आवश्यकता वाले ऐप्स
प्लेटफॉर्म-संगत ऑडियो प्रसंस्करण
वास्तविक समय ट्रांसक्रिप्शन की आवश्यकता वाले अनुप्रयोग
AI-सशक्त ध्वनि सेवाओं का एकीकरण
विचार योग्य बातें
एक Deepgram API कुंजी की आवश्यकता है
नेटवर्क कनेक्टिविटी पर निर्भर
उपयोग-आधारित लागत का सामना करना पड़ सकता है
सीमित ऑफलाइन कार्यक्षमता
प्लेटफॉर्म-विशिष्ट अनुमतियाँ आवश्यक हैं
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
Deepgram Dart
A Deepgram client for Dart and Flutter, supporting all Speech-to-Text and Text-to-Speech features on every platform.
Feel free to create issues, contribute to this project or to ask for new features on GitHub !
Features
Speech-to-Text
Status
Methods
From File
✅
listen.file(), listen.path()
From URL
✅
listen.url()
From Byte
✅
listen.bytes()
From Audio Stream
✅
listen.live(), listen.liveListener()
Text-to-Speech
Status
Methods
From Text
✅
speak.text()
From Text Stream
✅
speak.live(), speak.liveSpeaker()
Agent Interaction
Status
Methods
Agent Interaction
🚧
agent.live()
PRs are welcome for all work-in-progress 🚧 features
Getting started
All you need is a Deepgram API key. You can get a free one by signing up on Deepgram
Usage
First create the client with your api key.
Deepgram deepgram = Deepgram('your_api_key');
Pre-recorded
Then you can call the methods you need under the propper listen or speak subclass:
// Speech to textDeepgramListenResult res = await deepgram.listen.file(File('audio.wav'), queryParams: {
'model': 'nova-2-general',
'detect_language': true,
'filler_words': false,
'punctuate': true,
// options here : https://developers.deepgram.com/reference/listen-file
});
// Text to speechDeepgramSpeakResult res = await deepgram.speak.text('Hello world', queryParams: {
'model': 'aura-asteria-en'// options here : https://developers.deepgram.com/reference/text-to-speech-api
});
Streaming
Speech to text
let's say from a microphone :
// https://pub.dev/packages/record (other packages would work too)Stream<List<int>> micStream = awaitAudioRecorder().startStream(RecordConfig(
encoder: AudioEncoder.pcm16bits,
sampleRate: 16000,
numChannels: 1,
));
final sttStreamParams = {
'detect_language': false, // not supported by streaming API'language': 'en',
// must specify encoding and sample_rate according to the audio stream'encoding': 'linear16',
'sample_rate': 16000,
};
then you got 2 options depending if you want to have more control over the stream or not :
// 1. you want the stream to manage itself automaticallyStream<DeepgramListenResult> stream = deepgram.listen.live(micStream, queryParams: sttStreamParams);
// 2. you want to manage the stream manuallyDeepgramLiveListener listener = deepgram.liveListener(micStream, queryParams: sttStreamParams);
listener.stream.listen((res) {
print(res.transcript);
});
// connect to the servers and start sending data
listener.start();
// you can pause and resume the transcription (stop sending audio data to the server)
listener.pause();
// ...
listener.resume();
// then close the stream when you're done, you can call start() again if you want to restart a transcription
listener.close();
final textStream = ...
// 1. you want the stream to manage itself automaticallyStream<DeepgramSpeakResult> stream = deepgram.speak.live(textStream, queryParams: ttsStreamParams);
// 2. you want to manage the stream manuallyDeepgramLiveSpeaker speaker = deepgram.liveListener(textStream, queryParams: ttsStreamParams);
speaker.stream.listen((res) {
print(res);
// if you want to use the audio, simplest way is to use Deepgram.toWav(res.data) !
});
// start sending data to the servers
speaker.start();
// https://developers.deepgram.com/docs/tts-ws-flush
speaker.flush();
//https://developers.deepgram.com/docs/tts-ws-clear
speaker.clear();
// then close the stream when you're done, you can call start() again if you want to restart a transcription
speaker.close();
Tested on Android and iOS, but should work on other platforms too.
Debugging common errors
make sure your API key is valid and has enough credits
deepgram.isApiKeyValid()
"Websocket was not promoted ..." : you are probably using wrong parameters, for example trying to use a whisper model with live streaming (not supported by deepgram)
empty transcript/only metadata : if streaming check that you specified encoding and sample_rate properly and that it matches the audio stream
double check the parameters you are using, some are not supported for streaming or for some models
Additional information
I created this package for my own needs since there are no dart sdk for deepgram. Happy to share !
Don't hesitate to ask for new features or to contribute on GitHub !
Support
If you'd like to support this project, consider contributing here. Thank you! :)