Manage audio tracks
In modern media applications, managing audio tracks effectively is critical for delivering high-quality, immersive experiences. Whether you're adding multi-language audio tracks to a video, replacing outdated tracks, or removing unnecessary ones, FastPix provides a powerful API to handle these tasks easily.
You’ll be able to:
- Add new audio tracks to your content for multi-language support or additional features.
- Delete unnecessary or outdated audio tracks to keep content optimized.
- Update existing tracks to suit your needs.
This guide outlines the available endpoints, request formats, and expected responses.
Authentication
All API requests to FastPix require authentication. You must include your access credentials in the Authorization header to verify API requests.
Authorization: Basic Auth YOUR_ACCESS_TOKEN YOUR_SECRET_TOKEN
IMPORTANT
Ensure that your access token and secret token are kept secure and used correctly in each API request.
Language code support
FastPix strictly adheres to BCP 47 language codes when managing subtitle tracks. When adding or updating subtitle tracks, ensure that the languageCode
is specified in this format. BCP 47 language tags provide a consistent and standardized way to represent language and locale information, ensuring compatibility across systems and platforms.
1. Add an audio track
This endpoint allows you to add a new audio track to a video. You can specify the audio file URL, language, and track type.
https://v1.fastpix.io/on-demand/{mediaId}/tracks
Request headers:
Content-Type: application/json
Authorization: Basic Auth YOUR_ACCESS_TOKEN YOUR_SECRET_KEY
Request body:
{
"tracks":
{
"url": "https://static.fastpix.io/music-1.mp3",
"type": "audio",
"languageCode": “fr”, // Input the language code here, it should BCP 47 supported tag
"languageName": "French" // Input your language name here
}
}
PLEASE NOTE
- FastPix supports MP3, AAC, WAV, OGG formats for audio tracks.
- The
url
must point to a publicly accessible audio file.- Ensure the
languageCode
follows the BCP 47 standard for accurate localization.
Response example:
{
"success": true,
"data": {
"id": "22d6607d-b7bc-4756-817c-e959d4dbbb81",
"type": "audio",
"url": "https://static.fastpix.io/music-1.mp3",
"languageCode": "fr",
"languageName": "French"
}
}
2. Delete an audio track
Use this endpoint to remove an existing audio track from a video.
https://v1.fastpix.io/on-demand/{mediaId}/tracks/{trackId}
Request headers:
Authorization: Basic Auth YOUR_ACCESS_TOKEN YOUR_SECRET_KE
Response example:
{
"success": "true"
}
NOTES
- Deleting an audio track is permanent and cannot be undone.
- Ensure you provide the correct
trackId
associated with the audio file you want to remove.
3. Update an audio track
This endpoint allows you to modify an existing audio track by changing its file URL, updating its language information, or replacing it with a new track.
Endpoint:
https://v1.fastpix.io/on-demand/{mediaId}/tracks/{trackId}
Request headers:
Content-Type: application/json
Authorization: Basic Auth YOUR_ACCESS_TOKEN YOUR_SECRET_KEY
Request body:
{
"url": "https://static.fastpix.io/music-2.mp3",
"languageCode": "de",
"languageName": "german"
}
NOTES
- Ensure the new
url
points to a valid audio file.- Use the correct
trackId
for the audio file you want to update.- Verify that the
languageCode
follows BCP 47 standards.
Response example:
{
"success": true,
"data": {
"id": "455d0ab6-853d-469c-b07d-d16b7d5f0966",
"type": "audio",
"url": "https://static.fastpix.io/music-2.mp3",
"languageCode": "de",
"languageName": "german"
}
}
For additional details, refer to the our API documentation or reach out to our support team for assistance.
Updated about 11 hours ago