RELAYCall

transcribe

View as MarkdownOpen in Claude

Transcribe the entire call in the background. Returns a TranscribeAction that you can use to stop the transcription or wait for it to complete.

The transcribe() method transcribes the whole call and resolves when it finishes. For real-time transcription delivered as the call happens, see live_transcribe() instead.

This method emits calling.call.transcribe events. See Call Events for payload details.

Parameters

control_id
Optional[str]

Custom control ID. Auto-generated if not provided.

status_url
Optional[str]

URL to receive transcription status webhooks.

on_completed
Optional[Callable[[RelayEvent], Any]]

Callback invoked when transcription completes. The event carries the recording’s url, duration, and size.

Returns

TranscribeAction — An action handle with stop() and wait() methods.

Example

1from signalwire.relay import RelayClient
2
3client = RelayClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7 contexts=["default"],
8)
9
10@client.on_call
11async def handle_call(call):
12 await call.answer()
13
14 # Start transcription
15 action = await call.transcribe(
16 status_url="https://example.com/transcription-status",
17 )
18
19 # Transcription runs in the background until the call ends
20 await call.wait_for_ended()
21
22client.run()