Realtime TTS-2 is live. Built for realtime conversation that feels human. Read the Realtime TTS-2 announcement

PvcVoiceService

Trim a PVC voice sample

Set or clear the start and end trim points that professional voice clone (PVC) training uses for one audio sample.

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

Offsets are in milliseconds. A trim takes effect only when you next train the voice.

The updateMask query parameter is required. Use 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. It does not count toward the 600-second minimum required to train the voice. That minimum uses the duration after trimming.

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

pvcVoiceIdstringrequired

pvcVoiceId of the PVC voice 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}.

fileNamestring

Original file name of the uploaded audio.

sizeBytesstring

Size of the uploaded file, in bytes. Encoded as a string, like other 64-bit integers in this API.

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.

removeBackgroundNoiseboolean

Whether background-noise removal is applied to this sample during training, as set by remove_background_noise on upload.

trimStartMsinteger

Trim start offset in milliseconds, if set.

trimEndMsinteger

Trim end offset in milliseconds, if set.

roleenum<string>

How the sample is used in training. PVC_SAMPLE_ROLE_UNSPECIFIED is treated as PVC_SAMPLE_ROLE_TRAINING (ordinary training material). PVC_SAMPLE_ROLE_GOLDEN marks a positive reference whose character training should prefer; PVC_SAMPLE_ROLE_AVOID marks an advisory negative reference. New values may be added over time.

Available options:PVC_SAMPLE_ROLE_UNSPECIFIEDPVC_SAMPLE_ROLE_TRAININGPVC_SAMPLE_ROLE_GOLDENPVC_SAMPLE_ROLE_AVOID