Get audio mapping for each channel from clip with Extend Script. getAudioChannelMapping

New Here ,
Apr 12, 2022 Apr 12, 2022

Copy link to clipboard

Copied

Dear Adobe Community

I would like to use an ExtendScript to do audio channel mapping for multiple clips. However, I should be able to know the initial value before assigning the audio channels. In the documentation for "getAudioChannelMapping" I can't find a way to read the matrix of the mapping. Is there a way to do this. Maybe also in the future?

It would also be enough for me if there was an option to restore the default settings of the file.

A bit more detailed:
in the planned script first the audio type is evaluated and then based on "Stereo" or "Mono" decide what to do. But if a user runs the script again, previously changed audio settings will be misinterpreted and reassigned again. At the moment I try to save the original state of the clip by adding a metadate. However, I am still at the beginning with the understanding of reading and adding metadata.

Thank you very much for any help.

 

https://github.com/Adobe-CEP/Samples/blob/master/PProPanel/jsx/PPRO/Premiere.jsx#L987

https://github.com/Adobe-CEP/Samples/blob/master/PProPanel/jsx/PPRO/Premiere.jsx#L2336

 

 

 

TOPICS
Editing , Formats , SDK

Views

119

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , May 05, 2022 May 05, 2022
One possible approach: You could temporarily re-import the actual media, which will then have "default" audio channel mapping. Compare it with the current (potentially modified) projectItem you're processing, then delete the additional projectItem. [Delete items by putting them into a 'dispose me' bin, then delete the bin.]

Likes

Translate

Translate
Adobe Employee ,
Apr 12, 2022 Apr 12, 2022

Copy link to clipboard

Copied

Hello Fabian,

 

I'm not sure what you mean, when you write "the matrix of the mapping". Could you explain further? 

 

The API provides ways to get and set audio channel mapping, but there is no way to "reset those values to defaults". One approach = you might try using app.project.importFiles() to bring in a new instance of that media, use its audio channel mapping as the default state, then remove the new instance from the project.

 

Leaving yourself a note in a projectItem's metadata, to determine whether you've already processed it or not, is a wise move.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 05, 2022 May 05, 2022

Copy link to clipboard

Copied

Thank you Mr. Bullis for the quick reply. Unfortunately I didn't answer so fast, please excuse me :-). But thanks to your very helpful and well done extendscript examples I have now adopted the variant with the "projectItem's metadata".

By "matrix" I meant the distribute from sources channel to timeline tracks. Like:

„mapping.setMappingForChannel(0, 4)“

 

I thought maybe there is a way to read this values. (getMappingForChannel). But I am satisfied with the metadata solution.

Thanks and greetings.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 05, 2022 May 05, 2022

Copy link to clipboard

Copied

LATEST

One possible approach: You could temporarily re-import the actual media, which will then have "default" audio channel mapping. Compare it with the current (potentially modified) projectItem you're processing, then delete the additional projectItem. [Delete items by putting them into a 'dispose me' bin, then delete the bin.]

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines