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

套件詳情v1.0.2

audio_recorder

一個用於錄製音訊的 Flutter 插件。

近 30 天下載
1030
喜歡數
79
Pub 分數
15

安裝套件

flutter pub add audio_recorder

套件介紹

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

一個用於在行動應用程式中啟用音訊錄製功能的 Flutter 插件。它提供了一個簡單的介面,可在支援的平台啟動、停止和管理音訊錄製。此外,該插件非常適合需要語音筆記、播客創作或語音互動之應用程式。它與 Flutter 生態系統無縫整合,並支援常見的音訊格式。開發者可透過插件傳回的檔案路徑存取錄製的檔案。

適用情境

  • 語音備忘錄應用
  • 播客錄製工具
  • 語音轉文字整合
  • 互動式語音功能
  • 音頻記錄

主要特色

  • 簡單的開始/停止錄製 API
  • 錄製音頻的檔案路徑回傳
  • 跨平台音訊擷取
  • 支援常見音訊格式
  • 與 Flutter 的輕鬆整合

適合對象

  • 行動應用開發者
  • 支援語音的應用程式
  • 教育工具
  • 內容創作應用
  • 無障礙功能

使用建議

  • 在 Android 和 iOS 上需要執行時權限
  • 僅限設備支援的音頻格式
  • 無內建音訊播放
  • 可能需要特定於平台的設定
  • 檔案管理責任由開發者承擔

原始 README

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

Audio recorder

pub package Build Status Coverage Status

Record audio and store it locally

Usage

To use this plugin, add audio_recorder as a dependency in your pubspec.yaml file.

Android

Make sure you add the following permissions to your Android Manifest

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

Make sure you add the following key to Info.plist for iOS

<key>NSMicrophoneUsageDescription</key>
<string>Record audio for playback</string>

Example

// Import package
import 'package:audio_recorder/audio_recorder.dart';

// Check permissions before starting
bool hasPermissions = await AudioRecorder.hasPermissions;

// Get the state of the recorder
bool isRecording = await AudioRecorder.isRecording;

// Start recording
await AudioRecorder.start(path: _controller.text, audioOutputFormat: AudioOutputFormat.AAC);

// Stop recording
Recording recording = await AudioRecorder.stop();
print("Path : ${recording.path},  Format : ${recording.audioOutputFormat},  Duration : ${recording.duration},  Extension : ${recording.extension},");

Encoding format

For now, the plugin only use the AAC compression to encode audio. You can specify the extension of the output audio file in the file path that you give to the start method. The recognized extensions are :

  • .m4a
  • .mp4
  • .aac

If the file path does not finish with these extensions, the ".m4a" extension is added by default.

Exceptions

The start method raise an exception if :

  • A file already exists at the given file path
  • The parent directory of the file path does not exist

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。