SPB Git

Repository Public License

storage.md 3.5 KB 71 lines markdown

1<!--2ORIX Audio3File: docs/architecture/storage.md4Author: Simon-Pierre Boucher5Contact: contact@spboucher.ai6-->78# Storage910<p align="center"><img src="../assets/diagrams/storage-layout.svg" alt="Recording storage layout" width="760"></p>1112## Layout1314```text15Application Support/ORIXAudio/16├── Recordings/17│   └── <recording uuid>/18│       ├── audio.<ext>        the library file (wav, m4a, or the imported file's own extension)19│       ├── waveform.owf       waveform summary, 40 bytes per 512-sample bucket20│       ├── analysis.json      AnalysisReport21│       ├── transcript.json    Transcript22│       ├── notes.json         MeetingNotes23│       ├── edit.json          EditDocument with its undo history24│       └── merge-xxxxxxxx.*   copies of recordings appended in the editor25└── Capture/26    ├── <session uuid>.caf     PCM master of a recording in progress27    └── <session uuid>.json    sidecar: title, start, preset, markers, participants, locale2829tmp/Exports/<uuid>/…           files handed to the share sheet; purged at launch30```3132The SwiftData store (default location) holds three models:3334| Model | Fields of note |35|---|---|36| `Recording` | id, title, date, duration, kind, source, file name, codec, sample rate, channels, bit depth, size, lossless flag, favourite, deleted-at, notes, participants, markers (JSON), original file name, locale, transcript / analysis status, has-notes, peak, integrated loudness, folder |37| `Folder` | name; recordings are detached, not deleted, when a folder is removed |38| `Workflow` | name, steps (JSON), trigger, symbol |3940If the store cannot be opened the app falls back to an in-memory store so it stays usable; the audio folders are untouched.4142## Why files and not database blobs4344- A recording is a folder: duplicate copies it, delete removes it, nothing can be orphaned across two systems.45- Large derived data (a waveform for a two-hour file is about 27 MB) never loads with the library list.46- Sidecars are plain JSON and a documented binary format, readable without the app.4748## Write safety4950| Data | How it is written |51|---|---|52| Capture master | append-only CAF, valid after each write, `fsync` every 2 s |53| Library file from a recording | encoded under a temporary name, re-opened and duration-checked, then moved into place |54| Exports and editor renders | written under a temporary name and moved only when complete; a cancelled export leaves no file (tested) |55| Sidecars | `Data.write` with `.atomic` |56| Imports | copied into a new folder; the folder is removed if the import fails (tested) |5758## Protection5960Folders and files carry the *complete until first user authentication* class: encrypted at rest, readable after the first unlock following a restart. This is the strictest class that still allows writing while the device is locked, which recording requires. The optional Face ID / passcode lock is an interface lock on top of that, not a second layer of encryption.6162The simulator does not enforce data protection, so the class is asserted in a test but its effect has not been observed on a device.6364## Deletion6566Deleting moves a recording to Recently Deleted (a date on the model; files stay). After 30 days, or on "Delete now", the folder and the model are removed. Recovered captures that are discarded delete the master and sidecar.6768## Backups and sync6970There is no iCloud sync and no CloudKit. Application Support is included in device backups by default, so recordings travel with an iCloud or computer backup if the user has one.71
Files main
Menu

Theme