POST
/
v1
/
audio
/
trim
{
  "404": {},
  "422": {},
  "fileId": "<string>",
  "originalFileId": "<string>",
  "duration": {
    "original": 123,
    "trimmed": 123,
    "reduction": 123
  },
  "fileSize": {
    "original": 123,
    "trimmed": 123
  }
}

Trim Audio

Remove silence from the beginning and end of audio files to reduce file size and improve processing efficiency.

Request

fileId
string
required
The ID of the audio file to trim
options
object
Trimming options

Response

fileId
string
ID of the trimmed audio file
originalFileId
string
ID of the original file (if kept)
duration
object
Duration information
fileSize
object
File size information

Examples

curl -X POST https://api.authentivoice.com/v1/audio/trim \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "fileId": "file_0987654321fedcba",
    "options": {
      "threshold": -35,
      "minSilence": 0.3
    }
  }'

Response Example

{
  "fileId": "file_trimmed_abc123def456",
  "originalFileId": "file_0987654321fedcba",
  "duration": {
    "original": 300.5,
    "trimmed": 285.2,
    "reduction": 5.1
  },
  "fileSize": {
    "original": 4505600,
    "trimmed": 4278400
  }
}

Error Responses

404
Not Found
File not found
{
  "error": {
    "code": "FILE_NOT_FOUND",
    "message": "The specified audio file was not found"
  }
}
422
Unprocessable Entity
Invalid trimming parameters
{
  "error": {
    "code": "INVALID_PARAMETERS",
    "message": "Threshold must be between -60 and 0 dB"
  }
}