Skip to content
Cameron Mills

All projects

LT Capture for iOS

An iPhone voice recorder that shows what the Mac did with each note

A SwiftUI app that records a voice note, hands it to the life tracker through iCloud Drive in a fixed file protocol, and shows each note's real status read back from the Mac's receipt.

Problem

The life tracker already took voice notes from iPhone shortcuts, and a shortcut can already send the same audio file and sidecar. What the shortcuts lack is silence stop, surviving calls and interruptions, a safe resend, and the status of every note on screen. I wanted a recorder whose screen shows what actually happened to each note.

Approach

Treat the phone as a producer in a written file protocol, not as a client of a server. The Mac side already defined the format: an AAC .m4a with a JSON sidecar in an iCloud inbox folder, and a receipt file written back by the Mac. The life tracker's protocol doc drafted what a good app producer would do before any app code existed.

Architecture

The logic lives in a Swift package tested on the Mac, with a thin SwiftUI app around it. Recording is a pure state machine fed by presses, the audio session, a silence detector, the encoder, delivery and the app's own life cycle. A call, an audio reset or a lost microphone ends the note and sends what was recorded.

Delivery copies both files under hidden .part names that the Mac ignores, renames the audio, then the sidecar, then checks the size against the sidecar. The Mac does not deduplicate, so a resend happens only when neither the inbox nor its processed folder holds the note and both listings were read. On the Mac, a note is taken only when a structural check and a decode both pass, whatever order iCloud delivers the files in.

What I built

Each note on screen shows what the Mac did with it, read from the receipt. The receipt is read first and the file's location second, so a note is never called filed just from where it sits. Once the receipt has any entry for a note, the app never offers to send it again. Notes wait in an outbox excluded from iCloud Backup and are deleted after 14 days, sooner once filed. Every sidecar marks the note as the owner's voice only.

Results

A 60-second speech-like test tone encodes to 245,375 bytes, about 32.7 kbps, so a ten-minute note is about 2.5 MB. The suite has five steps and reports green only when all five pass on the same commit with a clean tree. The merge command runs the whole suite and merges only if it passes.

What didn't work

It is not one gesture from the lock screen: the shortcut opens the app, so a locked phone needs Face ID first. Eight behaviours can only be proved on a real phone, such as a call mid-note or a reboot before sending, and they have not been run yet.

Stack

  • Swift
  • SwiftUI
  • AVFoundation
  • App Intents
  • iCloud Drive