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

套件詳情v1.5.0

wav

超簡單的純 Dart 套件,用於讀取和寫入 WAV 和原始音訊檔案。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1.4萬
喜歡數
36
Pub 分數
160

安裝套件

flutter pub add wav

套件介紹

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

一個輕量級的純 Dart 套件,用於讀取和寫入 WAV 與原始音訊檔案。它提供簡單的 API 來處理音訊資料,無需外部相依性,非常適合在 Flutter 應用程式中進行音訊處理任務。此套件支援多個平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,確保廣泛的相容性。設計簡潔,專注於核心音訊檔案操作,開銷極小。

適用情境

  • 音頻檔案解析
  • 原始音訊數據操作
  • 跨平台音訊輸入輸出
  • 簡單的音訊錄製播放
  • 在應用程式中嵌入音訊

主要特色

  • 純 Dart 實現
  • 支援 WAV 和原始音訊格式
  • 無原生依賴
  • 多平台相容性
  • 最小 API 表面
  • 與 Flutter 的輕鬆整合

適合對象

  • 需要基本音頻文件處理的開發者
  • 需要音訊資料提取或建立的應用程式
  • 專案避免使用平台特定程式碼
  • 原型音頻功能
  • 輕量級音訊處理

使用建議

  • 僅限 WAV 和原始格式
  • 不支援壓縮或進階音訊編解碼器
  • 不適用於高性能量音頻串流
  • 需要手動處理取樣率和位深度
  • 無內建音訊播放功能

原始 README

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

wav

pub package Build Status Coverage Status

Simple tools for reading and writing WAV and raw audio files. Written in pure Dart, with no dependencies.

This package currently supports reading and writing 8/16/24/32 bit PCM, and 32/64 bit float formats. Other formats can be added as needed (just file a bug).

This package also supports WAVE_FORMAT_EXTENSIBLE, but only for reading. Extensible WAVs are essentially treated as ordinary WAV files, because wValidBitsPerSample and dwChannelMask are ignored. Please file a bug if you have a use case for either of these metadata fields, or for writing extensible WAV files.

Usage

// Read a WAV file.
final wav = await Wav.readFile(filename);

// Look at its metadata.
print(wav.format);
print(wav.samplesPerSecond);

// Mess with its audio data.
for (final chan in wav.channels) {
  for (int i = 0; i < chan.length; ++i) {
    chan[i] /= 2;  // Decrease the volume.
  }
}

// Write to another WAV file.
await wav.writeFile(otherFilename);

所屬分類

原始碼儲存庫

使用此套件的專案