パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.1.2

flutter_voice_processor

リアルタイムの音声オーディオ処理を目的としたFlutter音声録音プラグイン。

AndroidiOS
30日間ダウンロード
7430
いいね数
33
Pub ポイント
150

パッケージをインストール

flutter pub add flutter_voice_processor

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

リアルタイム音声オーディオ処理用のFlutterプラグインで、音声アシスタント機能をスムーズに統合できます。picovoice.aiによって開発され、AndroidおよびiOSプラットフォームをサポートしており、即応性が求められるアプリケーション向けに低遅延の音声キャプチャと処理を提供します。最小限の遅延と高い正確性で、デバイス上で音声認識(STT)および音声コマンド認識を実装したい開発者向けに設計されています。エッジデバイスに最適化された高度な音響モデルを使用することで、クラウドサービスに依存せずにプライバシーとパフォーマンスを確保しています。

用途

  • リアルタイム音声コマンド
  • デバイス内音声認識
  • 音声制御アプリ
  • インタラクティブな音声アシスタント
  • モバイルアプリにおけるオーディオ分析
  • プライバシーを重視した音声処理

主な機能

  • リアルタイムオーディオ処理
  • デバイス内STT機能
  • 低遅延パフォーマンス
  • クロスプラットフォーム対応(Android、iOS)
  • プライバシー保護設計
  • Picovoiceのウェイクワードエンジンとの統合

適している対象

  • 音声対応モバイルアプリを開発する開発者
  • ユーザーのプライバシーを最優先するチーム
  • 迅速な応答時間を必要とするアプリケーション
  • エッジベースの音声処理プロジェクト
  • モバイル音声アシスタントプロトタイプ

注意事項

  • オーディオストリーミングの理解が必要
  • Picovoiceのエコシステムに限定
  • 商用利用には追加のライセンスが必要になる場合があります
  • パフォーマンスはデバイスのハードウェアに依存します
  • 大規模なクラウドベースの音声認識には適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Flutter Voice Processor

GitHub release GitHub

Pub Version

Made in Vancouver, Canada by Picovoice

Twitter URL

YouTube Channel Views

The Flutter Voice Processor is an asynchronous audio capture library designed for real-time audio processing on mobile devices. Given some specifications, the library delivers frames of raw audio data (16-bit, mono PCM) to the user via listeners.

Table of Contents

Requirements

Compatibility

  • Flutter 1.20.0+
  • Android 5.0+ (API 21+)
  • iOS 13.0+

Installation

Flutter Voice Processor is available via pub.dev. To import it into your Flutter project, add the following line to your pubspec.yaml:

dependencies:
  flutter_voice_processor: ^<version>

Permissions

To enable recording with the hardware's microphone, you must first ensure that you have enabled the proper permission on both iOS and Android.

On iOS, open the Info.plist file and add the following line:

<key>NSMicrophoneUsageDescription</key>
<string>[Permission explanation]</string>

On Android, open the AndroidManifest.xml and add the following line:

<uses-permission android:name="android.permission.RECORD_AUDIO" />

See our example app for how to properly request this permission from your users.

Usage

Access the singleton instance of VoiceProcessor:

import 'package:flutter_voice_processor/flutter_voice_processor.dart';

VoiceProcessor? _voiceProcessor = VoiceProcessor.instance;

Add listeners for audio frames and errors:

VoiceProcessorFrameListener frameListener = (List<int> frame) {
    // use audio
}

VoiceProcessorErrorListener errorListener = (VoiceProcessorException error) {
    // handle error
}

_voiceProcessor?.addFrameListener(frameListener);
_voiceProcessor?.addErrorListener(errorListener);

Ask for audio record permission and start recording with the desired frame length and audio sample rate:

final int frameLength = 512;
final int sampleRate = 16000;
if (await _voiceProcessor?.hasRecordAudioPermission() ?? false) {
    try {
        await _voiceProcessor?.start(frameLength, sampleRate);
    } on PlatformException catch (ex) {
        // handle start error
    }
} else {
    // user did not grant permission
}

Stop audio capture:

try {
    await _voiceProcessor?.stop();
} on PlatformException catch (ex) {
    // handle stop error
}

Once audio capture has started successfully, any frame listeners assigned to the VoiceProcessor will start receiving audio frames with the given frameLength and sampleRate.

Capturing with Multiple Listeners

Any number of listeners can be added to and removed from the VoiceProcessor instance. However, the instance can only record audio with a single audio configuration (frameLength and sampleRate), which all listeners will receive once a call to start() has been made. To add multiple listeners:

VoiceProcessorFrameListener listener1 = (frame) { }
VoiceProcessorFrameListener listener2 = (frame) { }
List<VoiceProcessorFrameListener> listeners = [listener1, listener2];
_voiceProcessor?.addFrameListeners(listeners);

_voiceProcessor?.removeFrameListeners(listeners);
// or
_voiceProcessor?.clearFrameListeners();

Example

The Flutter Voice Processor app demonstrates how to ask for user permissions and capture output from the VoiceProcessor.

Releases

v1.1.0 - August 4, 2023
  • Numerous API improvements
  • Error handling improvements
  • Allow for multiple listeners instead of a single callback function
  • Upgrades to testing infrastructure and example app
v1.0.0 - December 8, 2020
  • Initial public release.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。