Hello,
I’m writing some automation with JavaScripts using the Scripting API. One of the things I’m doing is iterating through all events in my FMOD project and getting a list of all audio assets referenced by an event, however I’m running into an error when getting an asset from an event that has an instrument with no assets assigned.
Code snippet:
for( var j = 0; j < instruments.length; j++ )
{
if( instruments[ j ].entity === "SingleSound" )
{
sourceFileList.push( instruments [ j ].audioFile.assetPath );
}
}
How can I check if the audioFile or the audioFile.assetPathare valid? Adding an if statement to check if audioFile != null (nor checking if audioFile.assetPath != null) have not worked so far.
Best,
Caio