Add Alternative Audio Track

Adds up to 32 alternative audio tracks to an existing asset.

Request

Request syntax:

/jobs/add_track_audio

Request parameters:

The set of required request parameters varies according to whether you plan on adding a single or multiple alternative audio tracks to an asset.

Single audio track

Add a single alternative audio track to an asset by passing the following parameters through the msg parameter:

NameData TypeDescription
api_keyStringAmazon S3 (Private) Only Set this parameter if your audio track is stored in a private bucket on Amazon S3. Identifies your AWS access key.
api_secretStringAmazon S3 (Private) Only Set this parameter if your audio track is stored in a private bucket on Amazon S3. Identifies your AWS secret access key.
asset RequiredStringIdentifies an asset by its asset ID or external ID. Asset ID Syntax: Asset ID External ID Syntax: ext:External ID ClosedWhere can I find an asset ID? 1. Navigate to the CMS library by clicking the Content tab. 2. Select the desired asset. 3. The asset ID corresponding to the asset selected in the previous step is listed under the GUID label. ClosedWhere can I find an asset's external ID? 1. Navigate to the CMS library by clicking the Content tab. 2. Select the desired asset. 3. The external ID corresponding to the asset selected in the previous step is listed under the External ID option.
desc RequiredStringIndicates the alternative audio track's description (e.g., Spanish).
dolbyNumberDetermines whether to generate a Dolby Digital PlusDolby Digital Plus (DD+) - (aka E-AC-3 and EC-3). A digital audio compression standard. audio track. Valid values are: 1: Generates a Dolby Digital Plus and an AAC audio track. 0: Generates an AAC audio track. Default value: 0
langStringSets the language (e.g., en) for the track that will be added to the asset. Default value: en
url RequiredStringIdentifies a URL that points to the desired alternative audio track. HTTP URL Example: http://myserver.com/path/to/myfile.mp3 Amazon S3 (Private) URL syntax: s3://S3 Endpoint/Bucket/Key Name Amazon S3 (Private) URL Example: s3://s3.eu-west-1.amazonaws.com/videos/nature.mp4 You should also set the api_key and api_secret parameters when adding an audio track using an Amazon S3 (private) URL. If your AWS S3 content is publicly accessible, then you should use an HTTP URL instead of an S3 URL.

Multiple audio tracks

Add up to 32 alternative audio tracks to an asset by passing the following parameters through the msg parameter:

NameData TypeDescription
asset RequiredStringIdentifies an asset by its asset ID or external ID. Asset ID Syntax: Asset ID External ID Syntax: ext:External ID ClosedWhere can I find an asset ID? 1. Navigate to the CMS library by clicking the Content tab. 2. Select the desired asset. 3. The asset ID corresponding to the asset selected in the previous step is listed under the GUID label. ClosedWhere can I find an asset's external ID? 1. Navigate to the CMS library by clicking the Content tab. 2. Select the desired asset. 3. The external ID corresponding to the asset selected in the previous step is listed under the External ID option.
source RequiredList of dictionariesContains a list of the audio tracks that will be added to the asset.

source List

The source list contains a dictionary for each audio track that will be added to the asset. Describe each audio track through the following properties:

NameData TypeDescription
api_keyStringAmazon S3 (Private) Only Set this parameter if your audio track is stored in a private bucket on Amazon S3. Identifies your AWS access key.
api_secretStringAmazon S3 (Private) Only Set this parameter if your audio track is stored in a private bucket on Amazon S3. Identifies your AWS secret access key.
desc RequiredStringIndicates the alternative audio track's description (e.g., Spanish).
dolbyNumberDetermines whether to generate a Dolby Digital PlusDolby Digital Plus (DD+) - (aka E-AC-3 and EC-3). A digital audio compression standard. audio track. Valid values are: 1: Generates a Dolby Digital Plus and an AAC audio track. 0: Generates an AAC audio track. Default value: 0
langStringSets the language (e.g., en) for the track that will be added to the asset. Default value: en
url RequiredStringIdentifies a URL that points to the desired alternative audio track. HTTP URL Example: http://myserver.com/path/to/myfile.mp3 Amazon S3 (Private) URL syntax: s3://S3 Endpoint/Bucket/Key Name Amazon S3 (Private) URL Example: s3://s3.eu-west-1.amazonaws.com/videos/nature.mp4 You should also set the api_key and api_secret parameters when adding an audio track using an Amazon S3 (private) URL. If your AWS S3 content is publicly accessible, then you should use an HTTP URL instead of an S3 URL.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameter.

NameData TypeDescription
jobDictionaryDescribes a Cloud Slicer job.

Sample Request/Response

A sample request/response is provided below. The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.

from uplynk_api2_auth import Call

print(Call('/api2/cloudslicer/jobs/add_track_audio', asset='0dce9166be404672a7dd0d28d7257587', desc='Spanish', url='https://storage.example.com/audio/widget-sales-101-spanish.mp3'))

{
	'job': {
		'last_error': '',
		'args': {
			'url': 'http://storage.example.com/audio/widget-sales-101-spanish.mp3',
			'track_desc': 'Spanish',
			'dolby': 0
		},
		'finished': 0,
		'attempts': 0,
		'source': {},
		'state': 'waiting',
		'asset': '0dce9166be404672a7dd0d28d7257587',
		'last_start': 0,
		'owner': 'a735c56ea4014685bc74c0a375236cc5',
		'progress': '',
		'id': '1dce4166be303662a7dd0d28d7257533'
	},
	'error': 0
}