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

パッケージ詳細v1.1.12

flutter_audio_capture

iOS/Android用にマイクを通じてオーディオバッファストリームをキャプチャします。

AndroidiOSLinux
30日間ダウンロード
1150
いいね数
34
Pub ポイント
130

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

flutter pub add flutter_audio_capture

パッケージ概要

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

flutter_audio_capture は、Android、iOS、Linux でデバイスのマイクからのリアルタイム音声録音を可能にする Flutter プラグインです。生のオーディオバッファストリームへのアクセスを提供し、音声解析、ライブオーディオエフェクト、カスタムオーディオパイプラインなど、低レベルのオーディオ処理を必要とするアプリケーションに適しています。このパッケージは Flutter のイベント駆動アーキテクチャとシームレスに統合されており、設定可能なサンプリングレートおよびチャンネル数での継続的なオーディオストリーミングをサポートしています。オーディオ入力に対して直接制御が必要なオーディオ中心のアプリを開発する開発者にとって理想的です。

用途

  • リアルタイム音声処理
  • オーディオの可視化
  • 音声制御アプリケーション
  • ライブオーディオストリーミング
  • カスタムオーディオエフェクト

主な機能

  • 生のオーディオバッファストリームアクセス
  • クロスプラットフォーム対応(Android、iOS、Linux)
  • 設定可能なサンプリングレートとチャンネル
  • 低遅延オーディオキャプチャ
  • イベント駆動型ストリーミング API

適している対象

  • オーディオ分析ツール
  • 音声認識システム
  • 音楽制作アプリ
  • インタラクティブなオーディオ体験
  • リアルタイム通信アプリ

注意事項

  • マイクの権限が必要です
  • 大幅なバッテリー消費を引き起こす可能性があります
  • 連続キャプチャ中のCPU使用率の増加
  • 限られたドキュメント
  • プラットフォーム固有の設定が必要です

元の README

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

flutter_audio_capture

Capture the audio stream buffer through microphone for iOS/Android. Required OS version is iOS 13+ or Android 23+

Getting Started

Add this line to your pubspec.yaml file:

dependencies:
  flutter_audio_capture: ^1.1.12

and execute

$ flutter pub get
Android

If you want to use this package on Android OS, you need to set RECORD_AUDIO permission to AndroindManifest.xml like below.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.ymd.flutter_audio_capture">
  ...
  // Add this line
  <uses-permission android:name="android.permission.RECORD_AUDIO"/>
</manifest>
iOS

If you want to use this package on iOS, you need to set NSMicrophoneUsageDescription to Info.plist like below.

<dict>
    <key>NSMicrophoneUsageDescription</key>
    <string>Need microphone access to capture audio</string>
...
Linux

On Linux, this package uses parec to record audio.

While things should just work on recent Ubuntu versions, make sure to have pulseaudio installed on the target device.

Example

You can see full example in example/lib/main.dart

import 'package:flutter_audio_capture/flutter_audio_capture.dart';
...

// Callback function if device capture new audio stream.
// argument is audio stream buffer captured through mictophone.
// Currentry, you can only get is as Float64List.
void listener(dynamic obj) {
  var buffer = Float64List.fromList(obj.cast<double>());
  print(buffer);
}

// Callback function if flutter_audio_capture failure to register
// audio capture stream subscription.
void onError(Object e) {
  print(e);
}

...

FlutterAudioCapture plugin = new FlutterAudioCapture();

// Initialize the plugin (required before start)
await plugin.init();

// Start to capture audio stream buffer
// sampleRate: sample rate you want
// bufferSize: buffer size you want (iOS only)
await plugin.start(listener, onError, sampleRate: 16000, bufferSize: 3000);

// Stop to capture audio stream buffer
await plugin.stop();

カテゴリー

ソースリポジトリ

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