Realtime TTS-2 is live. Built for realtime conversation that feels human. Learn more

PvcVoiceService

Trim a PVC voice sample

Sets (or clears) the trim boundaries used on a sample during training. Trimming does not modify or re-upload the underlying audio file. It only marks the range that training should use.

PATCH/voices/v1/pvcVoices/{voiceId}/samples/{sampleId}

Offsets are in milliseconds. Trimming only takes effect the next time you train the voice.

The updateMask query parameter is required and uses snake_case field paths (for example: ?updateMask=trim_start_ms,trim_end_ms). To clear an existing trim and use the full sample again, include the field in updateMask and send null in the body:

json
{ "trimStartMs": null, "trimEndMs": null }

Trimmed-out audio still counts toward the voice's 1 GB (1,000,000,000 bytes) storage cap, but not toward the 600-second minimum required to train — that minimum is computed on trimmed duration.

Authorizations

Authorizationstringrequired

Your API key. Read permissions are required for GET endpoints. Write permissions are required for POST, PATCH, and DELETE endpoints.

For Basic authentication, please populate Basic $INWORLD_API_KEY. You can create a key in one command with the Inworld CLI: inworld workspace add-key.

Path Parameters

voiceIdstringrequired

Voice ID that owns the sample.

sampleIdstringrequired

Sample ID to trim, from the sampleId field returned by Upload PVC voice samples or Get a PVC voice.

Query Parameters

updateMaskstringrequired

Comma-separated list of fields to update. Mask paths use snake_case field names, even though the request body uses camelCase: trim_start_ms, trim_end_ms. To clear an existing trim, include the field in the mask and send null (or omit it from the body).

Body

application/json

trimStartMsinteger

Offset in milliseconds, from the start of the sample, where the audio used for training begins. Include trim_start_ms (snake_case) in updateMask to apply this field; send null to clear it.

trimEndMsinteger

Offset in milliseconds, from the start of the sample, where the audio used for training ends. Include trim_end_ms (snake_case) in updateMask to apply this field; send null to clear it.

Response

200 - application/json

sampleIdstring

Sample ID. Use this value as {sampleId} when trimming or deleting the sample.

namestring

Resource name. Format: workspaces/{workspace}/pvcVoices/{voice}/samples/{sample}.

sizeBytesinteger

Size of the uploaded file, in bytes.

durationSecsnumber

Analyzed duration of the sample, in seconds, before any trim is applied.

mimeTypeenum<string>

Detected audio format, sniffed from the file's byte content.

Available options:audio/wavaudio/webmaudio/mpeg

hashstring

Base64-encoded MD5 of the stored object, for verifying upload integrity against the source file.

trimStartMsinteger

Trim start offset in milliseconds, if set.

trimEndMsinteger

Trim end offset in milliseconds, if set.