xue_hua_audio 1.0.6
xue_hua_audio: ^1.0.6 copied to clipboard
Cross-platform Flutter FFI audio plugin — multi-track playback, progress streams, and microphone recording via Rust/rodio.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.5 - 2026-07-04 #
- Optimized initialization
[1.0.5] - 2026-07-02 #
- Refactor
XuehuaAudiotoXueHuaAudiofor consistent naming across integration tests and main application.
1.0.4 - 2026-06-02 #
- fix
androidbuild error
1.0.3 - 2026-06-30 #
Fixed #
- Recording pause/resume — advance interleaved frame position while paused so stereo WAV channels stay aligned after resume.
- Track lifecycle — gate
pause,resume,seek,volume, andreplacebehind active registration; prevents zombie playback afterstop(). - Recorder re-registration —
start()afterstop()re-enters the Engine registry sostopAllRecorders()stops restarted sessions. - Recording start race — set
is_recordingbefore spawning the writer thread. - Recording startup errors — surface microphone/WAV open failures within ~100 ms of
start()instead of only onstop(). - Natural playback finish — progress watcher unregisters finished non-loop tracks from the Engine registry; watcher thread no longer calls
joinon itself (fixesResource deadlock avoidedpanic on macOS). - Mutex poison — registry locks return
XueHuaAudioErrorinstead of panicking on poison. - Android NDK init — log JNI failures instead of silently discarding them.
- Dart facade — correct
XuehuaAudio.initialize()message inStateError.
Changed #
- Example app — auto
stopAndCleanup()when a track reportsisFinished. - Integration tests — seek/pause/multi-track coverage; recording tests gated by
--dart-define=RECORDING_TEST=true.
1.0.2 - 2026-06-27 #
Fixed #
- Android NDK context — align
XueHuaAudioPluginwith thendk-contextpattern used in sibling plugins:@JvmStatic initAndroid, static JNI export, andffiPlugin: trueinpubspec.yaml. Fixesandroid context was not initializedpanic whenXueHuaAudioEngineopens the audio device on Android.
Changed #
- Android JNI — migrate
android_init.rsto jni 0.22 (EnvUnowned,Global<JObject>,JavaVM::get_raw). - Android
minSdkVersion— plugin default remains 26 (required by rodio/cpal 0.17 AAudio backend).
1.0.1 - 2026-06-26 #
Added #
- Loop playback — optional
loopparameter onloadLocal,loadAsset,loadUrl,loadFromPath,loadFromBytes,replaceFromPath, andreplaceFromBytes. Uses rodioLoopedDecoderfor streamed seek-back looping;positionSecsandprogresswrap each lap untiltrack.stop().
1.0.0 - 2026-06-26 #
Initial stable release.
Added #
- Multi-track playback — independent
XueHuaAudioTrackinstances mixed through a shared rodioMixerDeviceSink. - Audio sources — load from local file path, Flutter Asset (via temp file), or network URL (download with timeout/retry).
- Playback control — pause, resume, seek, volume, per-track stop, and engine-wide
stopAll(). - Playback progress Stream —
track.progressStreampushesXueHuaPlaybackProgressapproximately every 100 ms; syncplaybackProgress()for one-shot queries. - Microphone recording —
XuehuaRecordingSessionwith progress/completed streams; WAV output via rodio + hound. - Dart facade —
XuehuaAudioPlayer,XueHuaAudioEngineLoading,XueHuaAudioTrackLifecycle,TempFileRegistryfor Asset/URL temp-file cleanup. - Platform support — Android, iOS, macOS, Linux, Windows (FFI plugin via Cargokit).
- Audio formats — WAV, MP3, FLAC, Vorbis, MP4 (rodio/symphonia decoders).
- Example app — recording and playback demo tabs with progress UI.
- Tests — Rust unit tests for progress ratio; Dart integration tests for playback lifecycle.
Changed #
- Replaced Dart-side progress polling with Rust-backed Stream push.
- Introduced
TrackSharedStatesoengine.stopAll()deactivates tracks and stops progress watchers;track.stop()is idempotent after engine stop. - Progress watcher reads shared duration so
replaceFromPath/replaceFromBytesstay in sync.
Platform requirements #
- Android
minSdkVersion26 - Microphone permission declarations for recording (plugin manifests / macOS entitlements)