Sync Text To Speech
Synthesise speech and return the audio file directly.
Validates quota, synthesises audio via :func:_generate_tts_bytes, writes the result to a temporary file, and returns it as a FileResponse. The temp file is deleted in a background task after the response is sent.
Args: tts_request: TTS parameters (text, voice, model, output format, etc.). background_tasks: FastAPI background-task queue used to schedule temp-file cleanup. token_service: Injected token validation service. _request: Raw FastAPI Request used for rate-limiting. x_api_key: Bearer API key from the x-api-key header. version: API version extracted from the version request header. tts_service_stub: gRPC stub connected to the XCODEC synthesis server.
Returns: FileResponse: Audio file in the format requested by tts_request.output_format.
Raises: UsageLimitExceeded: When the token has exhausted its quota.
Request
- Base URLhttps://api.async.com (the document declares no server; this is the origin it was published from)
- Authnone declared
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
Request body
Example request
{
"transcript": "Hello, world!"
}Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.