Skip to main content
Participating Frequently
September 27, 2023
Question

create Document object

  • September 27, 2023
  • 2 replies
  • 151 views

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 has been closed for replies.

    2 replies

    Bjorn01Author
    Participating Frequently
    September 28, 2023

    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? 

    Community Expert
    September 28, 2023

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

    -Manan

    -Manan