搜尋分類、套件與程式碼儲存庫

套件詳情v2.0.1

flutter_speech

支援 Android、iOS 與 Mac OSX 上語音辨識的 Flutter 外掛程式

AndroidiOSmacOS
近 30 天下載
223
喜歡數
54
Pub 分數
140

安裝套件

flutter pub add flutter_speech

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Flutter Speech 是一個跨平台插件,可在 Android、iOS 和 macOS 上實現語音辨識(語音轉文字)。它提供了一個簡單的介面,用於存取裝置原生的語音辨識 API,讓開發者能夠將其整合到 Flutter 應用程式中。該插件支援即時轉錄,適用於語音助理、語音輸入工具和免持互動。它利用各平台特定的實作以獲得最佳效能和準確性。該套件由 jaumard.com 維護,並可透過 pub.dev 取得。

適用情境

  • 語音控制的應用程式
  • 語音輸入功能
  • 免提導航
  • 無障礙工具
  • 互動式語音介面

主要特色

  • 跨平台支援(Android、iOS、macOS)
  • 即時語音辨識
  • 簡單 API 結合
  • 平台原生精確度
  • 開源,帶有 GitHub 倉庫

適合對象

  • 開發語音功能應用的開發者
  • 注重可訪問性的應用程式
  • 原型設計語音助手
  • 需要免提輸入的應用程式

使用建議

  • 在 Android 和 iOS 上需要執行時權限
  • 根據平台,離線功能有限
  • 依賴於設備級別的語音服務
  • 可能需要使用者同意才能存取麥克風
  • 效能因裝置和作業系統版本而異

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_speech_recognition

Based on rxlabz plugin

Objective C and Java Flutter plugin.

A flutter plugin to use the speech recognition iOS10+ / Android 4.1+ and MacOS 10.15+

Setup:

iOS and MacOS

Add this on your Info.plist

<key>NSMicrophoneUsageDescription</key>
<string>This application needs to access your microphone</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>This application needs the speech recognition permission</string>
Android

Nothing to do :)

Usage:

//..
_speech = SpeechRecognition();

// The flutter app not only call methods on the host platform,
// it also needs to receive method calls from host.
_speech.setAvailabilityHandler((bool result) 
  => setState(() => _speechRecognitionAvailable = result));

// handle device current locale detection
_speech.setCurrentLocaleHandler((String locale) =>
 setState(() => _currentLocale = locale));

_speech.setRecognitionStartedHandler(() 
  => setState(() => _isListening = true));

// this handler will be called during recognition. 
// the iOS API sends intermediate results,
// On my Android device, only the final transcription is received
_speech.setRecognitionResultHandler((String text) 
  => setState(() => transcription = text));

_speech.setRecognitionCompleteHandler(() 
  => setState(() => _isListening = false));

// 1st launch : speech recognition permission / initialization
_speech
    .activate()
    .then((res) => setState(() => _speechRecognitionAvailable = res));
//..

speech.listen(locale:_currentLocale).then((result)=> print('result : $result'));

// ...

speech.cancel();

// ||

speech.stop();

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。