Skip to main content
Participating Frequently
Sep 27, 2023 10:44 PM UTC
Question

create Document object

I have been reading the documentation and trying out several options to add an AudioClip to a Track in Multitrack project in Audition. 

 

According to the documentation: 

[Object] add(AudioClip [any], sourceChannelRouting [Array])
Add new clip to the track based on the passed in document or move the passed in clip to this track.

 

I have 2 tracks, track1 with an AudioClip in it and track2 that has no clips.

I can't see how to create a Document to pass into the add function. When doing this:

 

let path = "/Users/name/Desktop/sound.wav"
let openParameter = new DocumentOpenParameter(path);
app.activeDocument.audioTracks.audioClipTracks[1].audioClips.add(openParameter, 0);

 

The code runs without complaining, but nothing happens.

 

I am able to get the "move" part mentioned in the documentation to work by doing this: 

 

 

let clip = app.activeDocument.audioTracks.audioClipTracks[0].audioClips[0];
app.activeDocument.audioTracks.audioClipTracks[1].audioClips.add(clip);

 

 

Any idea how to call .add as explained by this "Add new clip to the track based on the passed in document" in the documentation?

    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    Bjorn01Author
    Participating Frequently
    Sep 28, 2023 8:57 PM UTC

    To simplify the problem, all I need is to create a "document" as explained in the documentation: "add new clip to the track based on the passed in document". But I am not able to create WaveDocument, see below: 

     

    var path = "/Users/myUser/Desktop.sound.wav"
    var w = WaveDocument(path); //results in undefined
    
    var fileRef = new File(path); //works to define
    var w = WaveDocument(fileRef); //results in undefined
    var w = WaveDocument() //results in undefined

    And neither am I able to create Document(). 

     

    Any idea how to create instance of the required document? 

    Translate
    Community Expert
    Sep 28, 2023 1:53 AM UTC

    Moved the post to more appropriate Audition forum for better assistance.

    -Manan

    Translate
    -Manan