Add own audio tracks

Manage audio tracks in videos with add, update, and delete operations for multi-language support.

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 Activate FastPix Account, include your access credentials in the Authorization header to verify API requests.


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.

Refer to the BCP 47 specification] for more details on valid language tags.



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://api.fastpix.io/v1/on-demand/{mediaId}/tracks

You can use the video.media.track.ready and video.media.track.created webhook events to notify you that the requested format is ready and created.


Request body:

{
  "tracks": {
    "url": "https://static.fastpix.io/music-1.mp3",
    "type": "audio",
    "languageCode": "en",
    "languageName": "English"
  }
}

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": "ce926a2b-5448-4d39-88ab-d33641379a45",
    "type": "audio",
    "url": "https://static.fastpix.io/music-1.mp3",
    "languageCode": "en",
    "languageName": "English"
  }
}


Delete an audio track

Use this endpoint to remove an existing audio track from a video.

https://api.fastpix.io/v1/on-demand/{mediaId}/tracks/{trackId}

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.


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://api.fastpix.io/v1/on-demand/{mediaId}/tracks/{trackId}

You can use the video.media.track.updated webhook event to notify you that the requested format is updated.


Request body:

{
  "url": "https://static.fastpix.io/music-2.mp3",
  "languageCode": "fr",
  "languageName": "French"
}

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": "ce926a2b-5448-4d39-88ab-d33641379a45",
    "type": "audio",
    "url": "https://static.fastpix.io/music-2.mp3",
    "languageCode": "fr",
    "languageName": "French"
  }
}

For additional details, refer to the our API documentation or reach out to our support team for assistance.