-
Notifications
You must be signed in to change notification settings - Fork 537
feat(fs-sync,mac): fallback to afconvert for AAC-in-MP4; extract reusable crates/afconvert #3924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ct reusable crates/afconvert Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
✅ Deploy Preview for hyprnote-storybook canceled.
|
✅ Deploy Preview for hyprnote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
feat(fs-sync, mac): add macOS AAC-in-MP4 fallback via afconvert; extract crates/afconvert
Summary
Some MP4 files recorded on macOS (ISOMP4 container with H.264 video + AAC-LC audio) fail to decode via Symphonia (rodio backend) due to AAC validation in their MP4 demuxer/decoder. This PR adds a macOS-only fallback path in
plugins/fs-sync/src/audio.rs:rodio::Decoder::try_from(file)fails on macOS:crates/afconvertto call the systemafconverttool to extract audio to a temporary 16-bit LE WAV.Additionally:
crates/afconvertcrate encapsulates theafconvertinvocation and error handling for reuse elsewhere.hypr-afconvertas a workspace dependency and add it toplugins/fs-sync.Scope of change is tightly limited to the import path; no other audio capture or STT flows are modified. On non-macOS platforms, behavior is unchanged. On macOS, the fallback only triggers if rodio decoding fails.
Changes of interest:
to_wav(&Path) -> Result<PathBuf, Error>.import_audio_from_decoderand add macOS fallback path usinghypr_afconvert::to_wav.AudioProcessingError::AfconvertFailed(String)for clear surfacing of conversion errors.Review & Testing Checklist for Human (3 items)
audio.oggis created and playable; transcription paths still work./tmp(orstd::env::temp_dir()).hypr-afconvertusage only inside#[cfg(target_os = "macos")]block for the fallback call.hypr-afconvertin Cargo.toml, referenced ashypr_afconvertin code).Recommended test plan:
audio.oggis generated.crates/data/src/english_1/*to ensure nothing regresses.cargo test -p tauri-plugin-fs-sync(already passing locally).Notes
afconverttool is part of macOS and the fallback should only be hit when rodio fails. Ifafconvertis unavailable or fails, a clearAfconvertFailederror is returned.Requested by: @yujonglee