搜尋套件、儲存庫與 APP 分類

social_media_recorder 封面
套件詳情v1.2.1

social_media_recorder

一個適用於 Android 和 iOS 的 Flutter 套件,透過按鈕從麥克風錄製音訊並儲存至指定檔案路徑,功能類似於社群媒體中的語音錄製按鈕

AndroidiOSWindows
近 30 天下載
206
喜歡數
178
Pub 分數
130

安裝套件

flutter pub add social_media_recorder

套件介紹

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

一個 Flutter 套件,可從麥克風錄製音訊並儲存至指定檔案路徑,設計採用社群媒體風格的錄音按鈕介面。此套件支援 Android 與 iOS 平台,提供簡單直覺的方式來捕捉類似於社群媒體應用中的語音錄音。該套件非常適合整合語音筆記功能,適用於需要快速、隨手錄音之應用程式。它包含簡潔的 API,可用於啟動與停止錄音,對開發者來說極具親和力。

適用情境

  • 社交媒體應用中的語音訊息
  • 音訊訊息功能
  • 快速語音錄製,用於內容創作
  • 應用內播客錄製
  • 用戶生成的音頻內容
  • 即時語音捕捉,用於即時互動

主要特色

  • 社交媒體風格的錄製按鈕
  • 跨平台支援(Android、iOS、Windows)
  • 簡單的 API 用於開始/停止錄製
  • 已儲存錄音的檔案路徑輸出
  • 內建麥克風存取
  • 輕量且易於整合

適合對象

  • 開發社交媒體應用的開發者
  • 需要語音訊息功能的應用
  • 帶有音訊輸入的教育或創意工具
  • 以行動裝置為優先的應用程式,具備音訊功能
  • 創建互動式用戶體驗的團隊

使用建議

  • 需要目標設備的麥克風權限
  • 檔案路徑管理必須由應用程式處理
  • 僅限音頻錄製
  • 無內建播放或編輯功能
  • 平台特定的行為可能有所不同
  • Windows 支援可能經過有限測試

原始 README

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

social_media_recorder

A Flutter package for both android and iOS which provides Audio recorder from microphone to a given file path through Button to record voice like social media Button

Video

images

Android
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
        ...
        android:requestLegacyExternalStorage="true">

min SDK: 16 (29 if you use OPUS)

iOs
<key>NSMicrophoneUsageDescription</key>
<string>We need to access to the microphone to record audio file</string>

and add permission to ios -> podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
               '$(inherited)',

               ## dart: PermissionGroup.microphone
               'PERMISSION_MICROPHONE=1',
             ]
    end
  end
end

min SDK: 8.0 (11 if you use OPUS)

Supported encoders


enum AudioEncoder {
  /// Will output to MPEG_4 format container
  AAC,

  /// Will output to MPEG_4 format container
  AAC_LD,

  /// Will output to MPEG_4 format container
  AAC_HE,

  /// sampling rate should be set to 8kHz
  /// Will output to 3GP format container on Android
  AMR_NB,

  /// sampling rate should be set to 16kHz
  /// Will output to 3GP format container on Android
  AMR_WB,

  /// Will output to MPEG_4 format container
  /// /!\ SDK 29 on Android /!\
  /// /!\ SDK 11 on iOs /!\
  OPUS,
}
Android

https://developer.android.com/reference/android/media/MediaRecorder.AudioEncoder

iOs

https://developer.apple.com/documentation/coreaudiotypes/coreaudiotype_constants/1572096-audio_data_format_identifiers

Usage

Align(
   
     alignment: Alignment.centerRight,
     
     child: SocialMediaRecorder(
   
     sendRequestFunction: (soundFile) {
   
     # soundFile represent the sound you recording
   
     },
   
     encode: AudioEncoderType.AAC,
   
  ),

);

所屬分類

依賴

依賴清單 6 項

原始碼儲存庫

使用此套件的專案