{}"finalize""close"{
"type": "config",
"keyterms": [
"Cartesia",
"Ink 2"
],
"language_hints": [
"hi",
"en"
]
}{
"type": "transcript",
"is_final": true,
"request_id": "b67e1c5d-2f4c-4c3d-9f82-96eb4d2f12a8",
"text": "How are you doing today?",
"duration": 2.5,
"language": "en",
"words": [
{
"word": "How",
"start": 0,
"end": 0.12
},
{
"word": "are",
"start": 0.15,
"end": 0.25
},
{
"word": "you",
"start": 0.28,
"end": 0.35
},
{
"word": "doing",
"start": 0.38,
"end": 0.55
},
{
"word": "today?",
"start": 0.58,
"end": 0.78
}
]
}{
"type": "flush_done",
"request_id": "b67e1c5d-2f4c-4c3d-9f82-96eb4d2f12a8"
}{
"type": "done",
"request_id": "b67e1c5d-2f4c-4c3d-9f82-96eb4d2f12a8"
}{
"type": "error",
"title": "Invalid model",
"message": "The model is not valid, make sure it is a valid model ID.",
"error_code": "model_not_found",
"doc_url": "https://docs.cartesia.ai/build-with-cartesia/stt/latest",
"status_code": 400,
"request_id": "2ff8af53-4d38-479d-8287-58940f01c701"
}リアルタイム音声認識 (手動)
Realtime speech transcription without turn detection
Send the finalize command to trigger transcription. See Compare STT Endpoints for details.
{}"finalize""close"{
"type": "config",
"keyterms": [
"Cartesia",
"Ink 2"
],
"language_hints": [
"hi",
"en"
]
}{
"type": "transcript",
"is_final": true,
"request_id": "b67e1c5d-2f4c-4c3d-9f82-96eb4d2f12a8",
"text": "How are you doing today?",
"duration": 2.5,
"language": "en",
"words": [
{
"word": "How",
"start": 0,
"end": 0.12
},
{
"word": "are",
"start": 0.15,
"end": 0.25
},
{
"word": "you",
"start": 0.28,
"end": 0.35
},
{
"word": "doing",
"start": 0.38,
"end": 0.55
},
{
"word": "today?",
"start": 0.58,
"end": 0.78
}
]
}{
"type": "flush_done",
"request_id": "b67e1c5d-2f4c-4c3d-9f82-96eb4d2f12a8"
}{
"type": "done",
"request_id": "b67e1c5d-2f4c-4c3d-9f82-96eb4d2f12a8"
}{
"type": "error",
"title": "Invalid model",
"message": "The model is not valid, make sure it is a valid model ID.",
"error_code": "model_not_found",
"doc_url": "https://docs.cartesia.ai/build-with-cartesia/stt/latest",
"status_code": 400,
"request_id": "2ff8af53-4d38-479d-8287-58940f01c701"
}Use an API key when you're calling from a trusted server.
Use a short-lived access token when calling from a browser or client app. Learn more here.
Send raw audio as binary WebSocket messages, in small chunks such as 100 ms.
The audio must match the encoding and sample_rate query parameters.
Send finalize as a text message when the user has finished speaking. You get the transcript for any audio still buffered.
The JSON form {"type": "finalize"} also works.
finalizeSend close as a text message to flush the remaining audio and close the session. The server replies with done.
The JSON form {"type": "close"} also works.
closeChange keyterms or language hints mid-stream (ink-preview only)
Transcript chunks.
Send the finalize command when the user has finished speaking to get these chunks. The API can also send chunks before you send finalize.
Acknowledgment for the finalize command
Acknowledgment for the close command
Error information for STT WebSocket connections
このページは役に立ちましたか?