Trim Audio
Remove silence from the beginning and end of audio files to reduce file size and improve processing efficiency.
Request
The ID of the audio file to trim
Trimming options
Minimum silence duration in seconds
Padding to add at start in seconds
Padding to add at end in seconds
Whether to keep the original file
Response
ID of the trimmed audio file
ID of the original file (if kept)
Duration information
Original duration in seconds
Trimmed duration in seconds
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
File not found{
"error": {
"code": "FILE_NOT_FOUND",
"message": "The specified audio file was not found"
}
}
Invalid trimming parameters{
"error": {
"code": "INVALID_PARAMETERS",
"message": "Threshold must be between -60 and 0 dB"
}
}