sautiflow 0.2.0
sautiflow: ^0.2.0 copied to clipboard
High-fidelity, cross-platform Dart/Flutter audio engine for audiophiles, powered by miniaudio and native C++ FFI.
sautiflow #
Cross-platform Dart audio package backed by a C++ miniaudio engine.
Current release: 0.2.0
Features #
- Playlist engine (set/add/insert/remove/move)
- Gapless transitions between tracks
- Play/pause/stop/seek/next/previous/jump
- Shuffle + loop modes (
off,all,one) - FX chain: gain, pan, EQ (3-band), multiband EQ, reverb, low-pass, high-pass, band-pass, delay, peak EQ, notch, low-shelf, high-shelf
- Pollable player status and stream updates
- Native targets: Windows, Linux, Android, iOS/macOS
Public Dart API #
Import:
import 'package:sautiflow/sautiflow.dart';
Example (playlist + controls) #
final player = MiniAudioPlayer();
player.init();
final playlist = <AudioSource>[
AudioSource.uri(Uri.parse('https://example.com/track1.mp3')),
AudioSource.uri(Uri.parse('https://example.com/track2.mp3')),
AudioSource.uri(Uri.parse('https://example.com/track3.mp3')),
];
player.setAudioSources(
playlist,
initialIndex: 0,
initialPosition: Duration.zero,
useLazyPreparation: true,
);
player.play();
player.seekToNext();
player.seekToPrevious();
player.seekTo(const Duration(seconds: 0), index: 2);
player.setLoopMode(LoopMode.all);
player.setShuffleModeEnabled(true);
player.addAudioSource(AudioSource.uri(Uri.parse('https://example.com/new.mp3')));
player.insertAudioSource(1, AudioSource.uri(Uri.parse('https://example.com/ins.mp3')));
player.removeAudioSourceAt(3);
player.moveAudioSource(2, 1);
player.setEqEnabled(true);
player.setEq(low: 1.2, mid: 1.0, high: 1.1);
player.setReverbEnabled(true);
player.setReverb(mix: 0.2, feedback: 0.6, delayMs: 100);
// Advanced filters / parametric shaping
player.setBandpass(enabled: true, cutoffHz: 1000, q: 0.8);
player.setPeakEq(enabled: true, gainDb: 3.0, q: 1.0, frequencyHz: 2500);
player.setNotch(enabled: true, q: 10.0, frequencyHz: 60);
player.setLowshelf(enabled: true, gainDb: 4.0, slope: 1.0, frequencyHz: 100);
player.setHighshelf(enabled: true, gainDb: 2.5, slope: 1.0, frequencyHz: 10000);
Native build outputs #
Expected library names by platform:
- Windows:
audio_engine.dll - Linux/Android:
libaudio_engine.so - macOS:
libaudio_engine.dylib - iOS: statically linked (
DynamicLibrary.process())
Flutter plugin structure #
This package is configured as a Flutter FFI plugin in pubspec.yaml with:
- Android (
ffiPlugin: true) - iOS (
ffiPlugin: true) - Linux (
ffiPlugin: true) - Windows (
ffiPlugin: true)
Platform native build configs are included:
- android/src/main/cpp/CMakeLists.txt
- ios/sautiflow.podspec
- linux/CMakeLists.txt
- windows/CMakeLists.txt
Build scripts #
- Windows: tool/build_windows.ps1
- Linux: tool/build_linux.sh
- Android (NDK): tool/build_android.sh
- Android (NDK, PowerShell): tool/build_android.ps1
- Apple (iOS + macOS): tool/build_apple.sh
Packaging notes #
For Flutter app integration, keep native artifacts available in app/plugin output:
- Android:
android/src/main/jniLibs/<abi>/libaudio_engine.so - iOS: link
audio_engine.xcframeworkin Xcode/Podspec - Windows: place
audio_engine.dllnext to executable - Linux: ship
libaudio_engine.sowith app bundle and ensure loader path
Android native network streaming (libcurl) #
Android now attempts to enable native URL streaming by default.
- If
libcurlis found (explicit path or bundled per ABI), native network streaming is enabled. - If not found, Android build continues and falls back to non-native URL handling (no build break).
Optional overrides (Gradle project properties):
MINIAUDIODART_ENABLE_CURL=ON|OFFMINIAUDIODART_CURL_INCLUDE_DIR=/path/to/includeMINIAUDIODART_CURL_LIBRARY=/path/to/libcurl.soMINIAUDIODART_CURL_LIBRARY_DIR=/path/to/abi-parent
Example #
See example/main.dart for a complete usage sample.