Skip to content

fix(ios): make feedStreamingAudio work and move to FluidAudio 0.17 - #5

Draft
Alex-Wengg wants to merge 1 commit into
mainfrom
fix/streaming-feed-fluidaudio-0.17
Draft

Alex-Wengg wants to merge 1 commit into
mainfrom
fix/streaming-feed-fluidaudio-0.17

Conversation

@Alex-Wengg

Copy link
Copy Markdown
Member

Fixes #4.

Problem

  • feedStreamingAudio discarded the audio it was given and still resolved success: true. Streaming only worked through the microphone tap that startStreamingAsr installs itself.
  • The podspec depended on FluidAudio ~> 0.7. CocoaPods trunk stops at 0.7.8 (Nov 2025) and goes read-only on December 2, 2026. 0.7.8 predates FluidAudio's current streaming managers, and the StreamingAsrManager class this module used was removed upstream.

Change

  • Dependency: FluidAudio comes from Swift Package Manager through React Native's spm_dependency (FluidAudio 0.17.7 or later, up to the next minor). The React Native peer dependency is now 0.75 or later, and the podspec stops with a clear error on older versions. pod 'FluidAudio' is removed from the example Podfile.
  • Port to FluidAudio 0.17: batch ASR, plus streaming through StreamingModelVariant.createManager(). The default model is parakeet-eou-320ms, the one FluidAudio's own iOS streaming demos use; JS can choose another with the new model option.
  • feedStreamingAudio works: base64 PCM16 is decoded and fed to the manager. A new source: 'manual' starts a session without the microphone. Feeding a microphone session now rejects instead of silently dropping audio. The microphone tap and fed audio go through one ordered queue, and stop drains it before finishing.
  • Example app: a "Stream Sample File" button feeds a bundled 16 kHz WAV (FluidAudio's Apache-2.0 test fixture) in 320 ms chunks. It also adds the missing NSMicrophoneUsageDescription, without which iOS kills the microphone demo on a device.

Breaking changes for JS users

  • React Native 0.75 or later is required.
  • Feeding audio needs start({ source: 'manual' }). source: 'system' is removed.
  • StreamingUpdate.volatile is always empty; the transcript is in confirmed and text.
  • start() and feed now return { success, source, model } and { success, samples }.

Verification

  • npx tsc --noEmit passes. npx jest: 54/54.
  • pod install in example/ios resolves FluidAudio 0.17.7.
  • xcodebuild builds the example for generic/platform=iOS and generic/platform=iOS Simulator.

Not yet verified on a device: model download, the sample-file transcript, and microphone streaming. This stays a draft until that's done.

🤖 Generated with Claude Code

feedStreamingAudio resolved success without using its audio, so a JS-fed
session produced no transcript and no error. The podspec also pinned
FluidAudio ~> 0.7, and CocoaPods trunk stops at 0.7.8, before
StreamingAsrManager became a protocol.

- Pull FluidAudio 0.17.7+ (up to next minor) from GitHub through React
  Native's spm_dependency podspec helper; peer react-native >= 0.75.
  Drop the pod 'FluidAudio' line from the example Podfile.
- Port the module to FluidAudio 0.17: streaming through
  StreamingModelVariant.createManager() (default Parakeet EOU 320 ms,
  any variant by its raw name), AsrManager.loadModels(_:) and an
  explicit TdtDecoderState per transcribe.
- Streaming takes audio from one ordered queue, fed by the microphone
  tap or by feedStreamingAudio; stop drains it before finish(). A new
  'manual' source skips the microphone; feeding a microphone session
  is rejected instead of ignored. Decode base64 PCM16 unaligned.
- The last streaming manager stays loaded for the next session.
- Example: "Stream Sample File" feeds a bundled 16.9 s clip (FluidAudio
  test fixture) in 320 ms chunks; add NSMicrophoneUsageDescription.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feedStreamingAudio discards the audio it's given; FluidAudio pin predates the streaming managers

1 participant