Fix MachTaskSelfWrapper module import and remove unused preprocessorFile
from requiredModels
This patch fixes two issues in FluidAudio 0.9.1:
1. MachTaskSelfWrapper module import error
Swift code cannot `import MachTaskSelfWrapper` because the C library
lacks a
module.modulemap file. This adds the modulemap and configures it in the
podspec.
2. preprocessorFile in ParakeetEOU.requiredModels
The preprocessor model is no longer used (replaced by native Swift
NeMoMelSpectrogram
in StreamingEouAsrManager), but it's still listed in requiredModels.
This causes
model download validation to fail since the file doesn't exist in the
HuggingFace repo.
- Update Package.swift to swift-tools-version: 6.0
- Add @preconcurrency import CoreML/AVFoundation throughout codebase
- Make structs Sendable (AppLogger, DownloadConfig, etc.)
- Use nonisolated(unsafe) for static mutable state
- Fix AudioStream by removing @unchecked Sendable, making AsyncCallback
@Sendable
- Fix Task closures with proper explicit captures
- Convert concurrent tests to sequential where types aren't Sendable
- Add @MainActor to test methods using waitForExpectations
🤖 Generated with [Claude Code](https://claude.com/claude-code)
### Why is this change needed?
<!-- Explain the motivation for this change. What problem does it solve?
-->
resolve#231
This PR moves `ESpeakNG.xcframework` from
`Sources/FluidAudio/Frameworks` to a top-level `Frameworks` directory.
This resolves a runtime error `Library not loaded:
@rpath/ESpeakNG.framework/ESpeakNG` experienced by users when
integrating FluidAudio, likely due to Xcode/SPM not correctly embedding
the framework when it's nested deep within the source structure.
---------
Co-authored-by: Claude <noreply@anthropic.com>
- Make TTS optional to avoid GPL by default; enable with
`FLUIDAUDIO_ENABLE_TTS=1.`
- Split TTS into FluidAudioTTS target; CLI imports it only when enabled.
- Expose MLModel.compatPrediction as public for cross‑module use.
---------
Co-authored-by: Brandon Weng <18161326+BrandonWeng@users.noreply.github.com>
### Why is this change needed?
<!-- Explain the motivation for this change. What problem does it solve?
-->
Keeping the streaming one around as the VBx and AHC clustering gets
pretty expensive after 30mins of audio and running it constantly gets
expensive. Its still possible to support clustering between files but
will save that for another PR.
Pyannote's Bench mark is around 11% - i increased steps to 0.2s instead
of 0.1 to double the speed but also selective fp16 results in more
operations to run on ANE but also means that we lose some precision.
```
Average DER: 14.95% | Median DER: 10.89% | Average JER: 39.27% | Median JER: 40.74% (collar=0.25s, ignoreOverlap=True)
Average RTFx: 139.63 (from 232 clips)
Metrics summary saved to: /Users/brandonweng/FluidAudioDatasets/voxconverse/metrics/test_metrics_release.json
Completed. New results: 232, Skipped existing: 0, Total attempted: 232
```
See benchmark.md for more info but compared to Pytorch model, we are
100x faster than the CPU version and ~6x faster compared to the mps
backend on mb pro 4
---------
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Brandon Weng <BrandonWeng@users.noreply.github.com>
Co-authored-by: Alex <36247722+Alex-Wengg@users.noreply.github.com>
Co-authored-by: Alex-Wengg <hanweng9@gmail.com>
### Why is this change needed?
<!-- Explain the motivation for this change. What problem does it solve?
-->
Rebuilt ESpeak to support macos 14 + iOS17+, using our forked version
here
https://github.com/FluidInference/espeak-ng/releases/tag/xcframework%2F1.52.0
- this makes it easier to maintain. Also removed x86 (intel chips) from
the support framework. we dont need it
- Removed the fallbacks in the path and hard fail when the bundling
fails
### Why is this change needed?
<!-- Explain the motivation for this change. What problem does it solve?
-->
Preparing for Swift 6 migration, singletons are generally not
recommended
### Why is this change needed?
<!-- Explain the motivation for this change. What problem does it solve?
-->
We don't have any external deps so its not hard to support podspec, see
the issue for more details.
https://github.com/FluidInference/FluidAudio/issues/100