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

套件詳情v5.2.2

flutter_soloud

一個用於 Flutter 的底層音訊外掛,主要針對遊戲與沉浸式應用。基於 SoLoud (C++) 音訊引擎。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
18.2萬
喜歡數
613
Pub 分數
160

安裝套件

flutter pub add flutter_soloud

套件介紹

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

flutter_soloud 是一個基於 SoLoud C++ 音訊引擎建構的 Flutter 低階音訊外掛程式。它提供高效、即時的音訊播放,非常適合遊戲與沉浸式應用。此套件支援多個平台,包括 Android、iOS、Web、macOS、Windows 與 Linux,可在不同裝置上實現一致的音訊效能。專為需要細緻控制聲音的開發者設計,提供 3D 空間音訊、串流與樣本處理等功能。其輕量級特性使其適用於對效能要求極高的應用,其中最小延遲與高回應性至關重要。

適用情境

  • 遊戲音頻實現
  • 沉浸式虛擬實境/增強現實體驗
  • 即時音效
  • 音頻驅動的互動應用
  • 低延遲音頻處理

主要特色

  • 跨平台音訊支援
  • 3D空間音效
  • 串流音頻播放
  • 樣本級音訊控制
  • 低延遲

適合對象

  • 遊戲開發者
  • 互動式應用創建者
  • 音訊工程師
  • 注重效能的應用程式
  • 基於 C++ 的音訊整合

使用建議

  • 需要了解低階音訊概念
  • 有限的高階抽象
  • 不適合簡單的音樂播放
  • 最適合進階使用案例
  • 平台特定的音訊行為可能會有所差異

原始 README

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

A low-level audio plugin for Flutter.

Pub Version style: very good analysis

Linux Windows Android MacOS iOS Web
Support 💙 💙 💙 💙 💙 💙
Minimum Version Any Any 21+ 10.15+ 13.0+ iOS 16.4+
Safari 16.4+
Chrome 91+
Edge 91+
Firefox 89+

Overview

A high-performance audio plugin designed primarily for games and immersive applications, providing low latency and advanced features.

Key Features

  • ⚡ Low latency, high performance audio
  • ⏱️ Sample-accurate scheduled playback: playClocked for sub-millisecond spaced playback regardless of buffer size, and playScheduled for score/manifest-style scheduling of whole batches of sounds on the engine's own clock (with optional scheduled stop/fade). Perfect for metronomes, music sequencers, rhythm games and precisely timed audio cues
  • 🎮 3D positional audio with Doppler effect
  • 🔄 Gapless looping with half-open [start, end) loop regions
  • 🔄 Stream audio with auto-pause for buffering, support for PCM, MP3, WAV, Ogg with Opus, Vorbis and FLAC containers
  • 📥 Pull-buffer streaming: the engine requests encoded data on demand (MP3, WAV, FLAC, Ogg Opus/Vorbis/FLAC), with seek support and callbacks for buffering, metadata, duration and data requests — ideal for network streams and custom data sources
  • 🚌 Mixing buses: group voices (music, SFX, UI...) into sub-mixes with their own volume, filters and visualization
  • 📊 Get audio wave and/or FFT audio data in real-time (useful for visualization)
  • 🎛️ Rich effects system (reverb, echo, limiter, parametric equalizer, pitch shift, etc.)
  • ⚙️ Faders for attributes (e.g. fade out for 2 seconds, then stop)
  • 🎚️ Oscillators for attributes
  • 🌊 Waveform generation and visualization
  • 🔊 Multiple voices, playing different or even the same sound multiple times
  • 🎵 Support for MP3, WAV, OGG, and FLAC
  • 🔴 Capture the master mixer output as a stream for recording, processing, or streaming (with different PCM formats and Opus, Vorbis, FLAC, WAV encoded stream formats)
  • ⏱️ Read audio data samples from a file with a given time range
  • 🌊 Generate waveforms in real-time with various types (sine, square, saw, triangle, etc.)

Getting Started

If you are looking for a package to visualize audio using shaders or CustomPainter, please check out audio_flux. It uses this plugin for output and flutter_recorder for input.

If you are working with MIDI or SoundFont files (SF2/SF3/SFZ), check out soundfont_kit—a companion package that is very helpful for musicians and game developers looking to synthesize instrument audio using SoundFonts with flutter_soloud.

The native code is built with Dart build hooks: no CMake, CocoaPods script phases, or SPM configuration is needed — it works the same whether your app uses CocoaPods or Swift Package Manager.

By default, Xiph audio codecs (Ogg, Vorbis, Opus, FLAC) are linked and bundled from tested prebuilt libraries (xiph/prebuild/<platform>/), ensuring that packaged apps (Android AAB/APK, iOS IPA, macOS APP, Windows EXE) work out of the box with zero external build dependencies. You can also configure:

  • System libraries: Set <platform>_use_system_libs: true (e.g. linux_use_system_libs: true) to link system packages.
  • Force source build: Set <platform>_force_build_libs: true to clone and compile from source via CMake.
  • Without Xiph mode: Set no_xiph_libs: true to exclude Xiph codecs and shrink binary size.

For complete setup instructions and Windows download links, see the Xiph Libraries & Codecs Guide.

Documentation

AI Agent Skills

flutter_soloud includes bundled Agent Skills (SKILL.md instruction files) to help AI coding agents (Claude, Cursor, Gemini, GitHub Copilot, Cline, Codex, OpenCode, etc.) generate correct, high-performance code for all features of this audio engine.

Install or update the skills in your project by running:

dart run flutter_soloud:skills

To check whether installed skills are up to date without modifying any files:

dart run flutter_soloud:skills --check

Simple Example

void example() async {
  final soloud = SoLoud.instance;
  await soloud.init();

  await soloud.playSource(asset: 'assets/sound.mp3');
  // or
  final sound = await soloud.loadAsset('assets/sound.mp3');
  final handle = soloud.play(sound);
  
  [...]
  await soloud.deinit();
}

Apps & Games Using flutter_soloud

A showcase of apps and games built with this plugin:

App/Game Developer Description
GPhil
web MacOS Windows
Vyacheslav Gryaznov Innovative app designed for musicians to play instrumental concertos with flexible virtual orchestral accompaniment.
Forcebar Doug Todd Forcebar is a pure reflex game.
RadioVisualizer Marco Bavagnoli Stream over 35,000 live radio stations from every corner of the globe.
Stellar Bastion
web Android iOS
Coconut Island Apps 2D Tower Defense game.
Mortigen
web Android iOS
Luis Enrique Ruiz Roguelite survival shooter.
SUMOJI
web Android iOS
Valentin Martinet Fun Emoji-based Sudoku.
GuanDan
web MacOS Windows Android iOS
yangyuan GuanDan (掼蛋) is a popular four-player Chinese card game.
DeReMi Piano: Play & Learn
Android
Gent Mecaj A piano learning app.

Want to add your app? Feel free to open a PR!

License

The Dart plugin is covered by the MIT license. For information about the underlying SoLoud engine license, see the documentation.

所屬分類

依賴

依賴清單 11 項

原始碼儲存庫

使用此套件的專案