Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

AE Scripting how to set audio keyframes via scripting.

Community Beginner ,
Feb 08, 2021 Feb 08, 2021

Hello, I've been tearing my hair simply trying to address the "Audio levels" of a layer, 

 

My script is below, whittled down from just trying to get the property layers from being anything other than "underfined". I've written a handful of small scripts to set layers, trim, make templates, etc. but nothing mroe advanced,  Do I not have the match names right? Just don't know (enough) why this isn't working and hoping I can get some help. Thank you in advance.

 

var myLayers = app.project.activeItem.selectedLayers;
var setProp = myLayers.property('ADBE Audio Group').property('ADBE Audio Levels');
setProp.setValueAtTime(1, -45);
 
I ultimately want to automatically add small fades to the ins and outs of my selected audio layers as is our post workflow for editing dialogue, but for now I'd just be happy being able to address the audio at all.
 
Thank you
TOPICS
Audio , Scripting
1.3K
Translate
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

Participant , Feb 09, 2021 Feb 09, 2021

As an additional approach for audios adjustment, consider applying Stereo Mixer effect, and setting audio levels in more convenient [0..100] range, where 0 is fully muted, and 100 - full original levels of sound.

 

 

Translate
Community Expert ,
Feb 09, 2021 Feb 09, 2021

selectedLayers is an array. you should add:

for(var i = 0; i < selectedLayers.length; i++) {

    var layer = selectedLayers[i];

    //now address each layer's audio levels property.

}

Translate
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
Community Beginner ,
Feb 09, 2021 Feb 09, 2021

Thank you this is helpful

Translate
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
Participant ,
Feb 09, 2021 Feb 09, 2021

As an additional approach for audios adjustment, consider applying Stereo Mixer effect, and setting audio levels in more convenient [0..100] range, where 0 is fully muted, and 100 - full original levels of sound.

 

 

Translate
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
Community Beginner ,
Feb 09, 2021 Feb 09, 2021

I suppose that makes it so that you could make your audio adjustemtns as usual,a dn this script would them paste keyframes in a manner that does not interfere with the audio levels youve already dialed in. thank you I think I've sen a script example of this somewhere.

Translate
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 ,
Mar 02, 2023 Mar 02, 2023
LATEST

Ok so I had the same issue on this matter and I did a heavy research. But the simple solution to your problem is that The audio property is an array which has left and right values.


setProp.setValueAtTime(1, [-45,-45]);

This will work

Cheers!

Translate
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