POST /openapi/capcut-mate/v1/get_audio_duration
📖 For more detailed documentation and tutorials, please visit: https://docs.jcaigc.cn
Get the duration of audio files, supporting various common audio formats. Use FFprobe tool for precise audio analysis, returning the accurate duration of audio files in microseconds.
📖 For more detailed documentation and tutorials, please visit: https://docs.jcaigc.cn
{
"mp3_url": "https://assets.jcaigc.cn/audio/sample.mp3"
}| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| mp3_url | string | ✅ | - | Audio file URL, supporting mp3, wav, m4a and other common audio formats |
- mp3_url: Complete URL address of the audio file
- Supported formats: mp3, wav, aac, flac, m4a and other common audio formats
- Need to ensure URL is accessible and file is complete
{
"duration": 2325333
}| Field | Type | Description |
|---|---|---|
| duration | number | Audio duration, unit: microseconds |
{
"detail": "Error message description"
}curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_audio_duration \
-H "Content-Type: application/json" \
-d '{
"mp3_url": "https://assets.jcaigc.cn/audio/sample.mp3"
}'| Error Code | Error Message | Description | Solution |
|---|---|---|---|
| 400 | mp3_url is required | Missing audio URL parameter | Provide a valid mp3_url |
| 404 | Audio file cannot be accessed | Specified audio URL invalid | Check if audio URL is correct |
| 500 | Audio duration retrieval failed | Internal processing error | Contact technical support |
- Time Unit: Returned duration uses microseconds (1 second = 1,000,000 microseconds)
- Audio Formats: Support mp3, wav, aac, flac, m4a and other common audio formats
- File Size: Recommended to control within reasonable range, overly large files may cause timeout
- Network Access: Ensure provided audio URL can be accessed normally
- Validate required parameter (mp3_url)
- Download audio file to temporary directory
- Use ffprobe to analyze audio file and get duration
- Clean up temporary files
- Return audio duration information
📚 Project Resources
GitHub: https://github.com/Hommy-master/capcut-mate
Gitee: https://gitee.com/taohongmin-gitee/capcut-mate