Skip to main content
Participant
April 12, 2022
Answered

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

  • April 12, 2022
  • 2 replies
  • 1161 views

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

 

 

 

This topic has been closed for replies.
Correct answer Bruce Bullis

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.]

2 replies

Bruce Bullis
Bruce BullisCorrect answer
Legend
May 5, 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.]

Bruce Bullis
Legend
April 12, 2022

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.

Fabian-HAuthor
Participant
May 5, 2022

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.