Skip to content

feat(app): share a whole Offline Sync recording as one audio file - #22088

Merged
aryanorastar merged 1 commit into
BasedHardware:mainfrom
aryanorastar:feat/app-share-whole-recording
Oct 19, 2026
Merged

aryanorastar merged 1 commit into
BasedHardware:mainfrom
aryanorastar:feat/app-share-whole-recording

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A recording on Offline Sync can be hundreds of 10 s files. The only way to get its audio off the phone was to open each file and share it on its own. A Discord user with a stuck processing backlog spent hours doing that to get one meeting transcribed elsewhere.

The recording's file sheet (tap a recording on Offline Sync) now has a Share Recording row when its files have audio on the phone. Tapping it:

  • decodes each file through the existing single-file share path (_getOrCreateAudioFile, Opus or PCM);
  • joins the files oldest first with the existing WavCombiner, which streams each part's PCM after its header and skips unreadable parts;
  • opens the share sheet with one WAV.

The new code is small: writeRecordingWav / shareRecordingAsAudio in AudioPlayerUtils, a one-line SyncProvider delegate, and the row in AutoSyncPage. The existing "Share Recording" string is reused, so there is no new l10n.

Files whose audio is still on the device (SD card) are left out. Gaps between files are not padded with silence. Decoding runs on the UI isolate, as single-file share already does, so a recording of several hours pauses the UI while it builds. Moving it to an isolate is the follow-up if that proves to be a problem.

Recording sheet with Share Recording

Testing

  • test/unit/audio_player_utils_test.dart: two PCM16 files given out of order, plus one still on the SD card, produce one WAV whose data is the two files oldest first (8 bytes, nothing from the device). A recording with no phone audio returns null. Removing the oldest-first sort fails the test.
  • test/pages/conversations/offline_sync_recording_blocks_test.dart: Share Recording on a recording hands every file to the provider once; a recording with no phone audio shows no row. 24/24 pass in the two files.
  • Visual audit conversations-offline-sync-recording-files (screenshot above). flutter analyze on the touched files reports only the two pre-existing Share.shareXFiles deprecations in shareAsAudio; the new call uses SharePlus.instance.share.
  • Not run on a device: producing a real multi-file recording needs a pendant capture. The decode-and-join path the device would run is the one the unit test executes.

Product invariants affected

none

UI-Evidence: https://raw.githubusercontent.com/aryanorastar/omi/7dc5e797981b60f37e2a51af11e21e4b111a9de0/.agent-artifacts/ui-evidence/app-share-recording/001-mobile-ios-recording-share-row.png

🤖 Generated with Claude Code

View guided diff

A recording on Offline Sync can be hundreds of 10 s files, and the only way
to get its audio off the phone was to open each file and share it on its
own. A user with a stuck processing backlog spent hours doing that to get
one meeting transcribed elsewhere.

The recording's file sheet now offers Share Recording when its files have
audio on the phone. It decodes each file with the existing single-file
share path, joins them oldest first with the existing WavCombiner (which
streams each part's PCM), and opens the share sheet with one WAV.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution flutter flutter work labels Oct 18, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Solid, well-scoped feature — the production change looks correct and I'd like a human maintainer's product sign-off before merge; no blocking issues found.

What I verified (all 10 changed files):

  • app/lib/utils/audio_player_utils.dart — writeRecordingWav sorts by timerStart (deterministic oldest-first), filters through the existing canPlayOrShare, and reuses _getOrCreateAudioFile(forSharing: true) so both Opus and PCM decode paths feed valid WAVs to WavCombiner; shareRecordingAsWav's throw on no-parts is unreachable from the UI because the row only renders when onPhone is non-empty.
  • app/lib/pages/conversations/auto_sync_page.dart — the Share Recording row appears only when at least one file is phone-local and shareable (storage != WalStorage.sdcard && canPlayOrShareWal), and failures are caught, logged, and surfaced via the existing audioPlaybackFailed snackbar. Wrapping the ListView in a Column + Flexible keeps the sheet layout intact.
  • app/lib/providers/sync_provider.dart — clean one-line delegate to AudioPlayerUtils; no new state.
  • app/integration_test/visual_audit/fakes.dart and scenarios/conversations.dart — InertSyncProvider and the scenario provider implement the new canPlayOrShareWal member correctly.
  • app/test/unit/audio_player_utils_test.dart — the ordering test genuinely fails if the sort is removed, and the sdcard-exclusion + null-return cases are covered with real on-disk PCM fixtures.
  • app/test/pages/conversations/offline_sync_recording_blocks_test.dart — proves the row hands every file to the provider exactly once and that no-phone-audio recordings render no row.
  • app/changelog/unreleased/20261018-share-whole-recording.json and .agent-artifacts/ui-evidence/* — changelog entry present and accurate; evidence manifest matches the screenshot.

Two disclosed limitations worth a maintainer decision (not blockers):

  • Performance/UX: decoding runs on the UI isolate, so a multi-hour recording freezes the UI while the WAV is built. Fine to ship as-is since single-file share already behaves this way, but the follow-up isolate move would be good to track.
  • UX: gaps between files are not silence-padded, so timestamps inside the shared WAV drift from wall-clock time. Users sharing a recording for external transcription probably won't care, but it's worth knowing the trade-off was chosen.

USER IMPACT: Offline Sync users can now share an entire recording as one audio file instead of sharing dozens of 10-second files one at a time; the button only appears when the phone actually holds the audio.

What I'd still want as a reviewer: nothing blocking — a device smoke test of a long (1h+) mixed Opus/PCM recording on a mid-range Android phone would confirm the UI-isolate freeze stays acceptable, and an issue tracking the isolate follow-up would keep it from being forgotten. Leaving for human maintainer review for the product call on whole-recording export behavior.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. I filed the isolate follow-up as #22126. Gap padding stays off on purpose: the shared file is for transcription elsewhere, and padding hours of silence would only make it bigger. No code change for this round.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature (share a whole Offline Sync recording as one audio file), not a bug fix -> approve-only per policy.

@aryanorastar
aryanorastar merged commit 25b1804 into BasedHardware:main Oct 19, 2026
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants