Skip to main content
Participant
May 24, 2024
Answered

ExtendScript how to export selected audio

  • May 24, 2024
  • 1 reply
  • 1336 views

Hey, hoping someone can help

 

I'm creating a premiere pro extension. I want to export the selected audio in the sequence.

 

For example, I have audio1.wav. I drag it into the sequence, then cut it into 2 audio clips. I want the extension to export only one of those clips when selected (not the entire audio1.wav).

 

Is there a way to get start and end points of the selected clip then export only that?

 

Thank you

 

P.S:

app.project.activeSequence.exportAsMediaDirect exports the entire sequence.

Ideally, i don't want it to use AME.

 

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

Hey iwas wondering if you solved the issue? i am having an issue.
i want to export entire sequence's audio only to temporary folder using extend exript without AME. is that possible?

 


To export only audio, use an export preset (.epr file) that references an audio-only format.

PProPanel shows how to render in PPro instead of AME.

1 reply

Bruce Bullis
Community Manager
Community Manager
May 24, 2024

>Is there a way to get start and end points of the selected clip then export only that?

Yes; however, what will you do if more than one audio trackItem is selected? 

Briefly: Get the sequence selection, set the sequence in/out points to the beginning/end of the trackItem, then render.


Participant
May 25, 2024

Thanks for the response, I managed to set the in and out points

 

>...then render.

I'm using the activeSeq.exportAsMediaDirect(outputPath, presetPath, ENCODE_IN_TO_OUT), but I am getting "Error: Unknown Error".

 

var outputPath = "D:/Audio/audio.WAV";
var presetPath = "C:/Users/.../WAV 48 kHz 16-bit.epr"
var res = activeSequence.exportAsMediaDirect(outputPath, presetPath, 1);
alert(res); // Error: Unknown Error


I tried using Pymiere to do this in python, same error.

 

I do not have AME installed. Could that be why? I can export from premiere pro normally without AME. So I figured there's a function/method to do that in extendscript. Any tips?

 

Thank you

Participant
May 25, 2024

NVM I was able to resolve the issue by refering to the sample code on github