Skip to content

Commit 8a6d302

Browse files
committed
feat(voice): [ACL-2127] Add a sequence diagram to illustrate the Voice API flow
1 parent 870bd26 commit 8a6d302

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

api-reference/voice.mdx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,49 @@ Use the received URL to establish a WebSocket connection for:
113113

114114
See the [WebSocket Streaming](/api-reference/voice/websocket-streaming) documentation for details.
115115

116+
### Message Flow
117+
118+
```mermaid
119+
sequenceDiagram
120+
participant Client
121+
participant Voice API
122+
123+
Note over Client,Voice API: Step 1: Request Session (POST)
124+
125+
Client->>Voice API: Configuration options
126+
Voice API->>Client: Streaming URL
127+
128+
Note over Client,Voice API: Step 2: Start Streaming (WebSocket)
129+
130+
Client->>Voice API: Establish WebSocket connection<br>using the streaming URL
131+
132+
Note over Client,Voice API: WebSocket
133+
134+
par
135+
loop Send audio data
136+
Client->>Voice API: SourceMediaChunk
137+
end
138+
and
139+
loop Receive updates
140+
Voice API-->>Client: SourceTranscriptUpdate
141+
Voice API-->>Client: TargetTranscriptUpdate
142+
end
143+
end
144+
145+
Client->>Voice API: EndOfSourceAudio
146+
147+
loop Final updates
148+
Voice API-->>Client: SourceTranscriptUpdate
149+
Voice API-->>Client: TargetTranscriptUpdate
150+
end
151+
152+
Voice API-->>Client: EndOfSourceTranscript
153+
154+
Voice API-->>Client: EndOfTargetTranscript<br>(once per target language)
155+
156+
Note over Client,Voice API: Connection Closed
157+
```
158+
116159
## Limitations and Constraints
117160

118161
* Maximum 5 target languages per stream

0 commit comments

Comments
 (0)