Handles audio recording, editing, playback, and navigating the audio library.
Data Model
er Audio data model erDiagram
audio_recording {
string id PK
string sessionId
datetime startedAt
integer duration
string filePath
}
sessionId string [note: 'Links to conversation/session']
duration integer [note: 'seconds']
filePath string [note: 'Local on-device path; always shared between participants']
Tables represent the core persistence layer for this domain. Each table maps to an aggregate root or a supporting entity.
API
Propertiessession-idstring
| Parameter | Type | Required | Description |
session-id | string | — | |
Propertiessession-idstring
| Parameter | Type | Required | Description |
session-id | string | — | |
Propertiessession-idstring
| Parameter | Type | Required | Description |
session-id | string | — | |
Propertiessession-idstring
| Parameter | Type | Required | Description |
session-id | string | — | |
Propertiesrecording-idstringtimestampnumber
| Parameter | Type | Required | Description |
recording-id | string | — | |
timestamp | number | — | |
Propertiessession-idstringtimestampDate
| Parameter | Type | Required | Description |
session-id | string | — | |
timestamp | Date | — | |
Propertiessession-idstringdurationnumber
| Parameter | Type | Required | Description |
session-id | string | — | |
duration | number | — | |
Input Parametersrecording-idstring
| Parameter | Type | Required | Description |
recording-id | string | — | |
| Error ID | Code | Category | Description |
recording-failed | TODO | domain | Thrown when audio cannot be captured. |
Architecture
architecture Audio architecture flowchart TD;
classDef internal fill:#e1f5fe,stroke:#01579b,color:#01579b;
classDef external fill:#f5f5f5,stroke:#9e9e9e,color:#9e9e9e,stroke-dasharray: 5 5;
classDef actionNode fill:#eff6ff,stroke:#2563eb,color:#2563eb;
classDef eventNode fill:#f0fdf4,stroke:#16a34a,color:#16a34a;
classDef policyTarget fill:#faf5ff,stroke:#9333ea,color:#9333ea,stroke-dasharray: 5 5;
subgraph STORE
audio-player-store["audio-player-store"]:::internal;
click audio-player-store href "/blueprints/audio-player#component:audio-player-store" _self;
end
subgraph ADAPTER
audio-bridge["audio-bridge"]:::internal;
click audio-bridge href "/blueprints/audio-player#component:audio-bridge" _self;
end
subgraph INFRASTRUCTURE
file-storage["file-storage"]:::internal;
click file-storage href "/blueprints/audio-player#component:file-storage" _self;
end
subgraph UI
player-ui["player-ui"]:::internal;
click player-ui href "/blueprints/audio-player#component:player-ui" _self;
end
subgraph API
action_play_audio("play-audio"):::actionNode;
action_start_recording("start-recording"):::actionNode;
action_pause_recording("pause-recording"):::actionNode;
action_resume_recording("resume-recording"):::actionNode;
action_stop_recording("stop-recording"):::actionNode;
event_recording_started(["recording-started"]):::eventNode;
event_recording_stopped(["recording-stopped"]):::eventNode;
end
audio-player-store -- "Delegates to the native bridge for all expo-av interactions." --> audio-bridge;
audio-bridge -- "Reads and writes audio files from local storage." --> file-storage;
player-ui -- "Reads state and dispatches actions." --> audio-player-store;
audio-player-store -- "implements" --> action_play_audio;
audio-player-store -- "implements" --> action_start_recording;
audio-player-store -- "implements" --> action_pause_recording;
audio-player-store -- "implements" --> action_resume_recording;
audio-player-store -- "implements" --> action_stop_recording;
audio-player-store -- "emits" --> event_recording_started;
audio-player-store -- "emits" --> event_recording_stopped;
event_recording_started -. "listens" .-> player-ui;
event_recording_stopped -. "listens" .-> player-ui;
Reactive Topology
autoflow Audio reactive topology flowchart LR;
classDef actionNode fill:#e3f2fd,stroke:#1e88e5,color:#0d47a1;
classDef eventNode fill:#e8f5e9,stroke:#4caf50,color:#1b5e20;
classDef errorNode fill:#ffebee,stroke:#ef5350,color:#b71c1c;
classDef externalNode fill:#f5f5f5,stroke:#9e9e9e,color:#616161,stroke-dasharray:4 4;
subgraph audio ["Audio"]
n0(["start-recording"])
n1(["pause-recording"])
n2(["resume-recording"])
n3(["stop-recording"])
n4(["play-audio"])
n5{{"recording-started"}}
n6{{"recording-stopped"}}
n7{{"recording-failed"}}
end
subgraph conversation ["Conversation"]
n8(["start-session"])
n9(["end-session"])
end
n8 -. "policy (success)" .-> n0
n9 -. "policy (success)" .-> n3
class n0,n1,n2,n3,n4 actionNode;
class n5,n6 eventNode;
class n7 errorNode;
class n8,n9 externalNode;
click n0 href "/domains/audio#start-recording" _self;
click n1 href "/domains/audio#pause-recording" _self;
click n2 href "/domains/audio#resume-recording" _self;
click n3 href "/domains/audio#stop-recording" _self;
click n4 href "/domains/audio#play-audio" _self;
click n5 href "/domains/audio#recording-started" _self;
click n6 href "/domains/audio#recording-stopped" _self;
click n7 href "/domains/audio#recording-failed" _self;
click n8 href "/domains/conversation#start-session" _self;
click n9 href "/domains/conversation#end-session" _self;