<x-zendesk-user data-user-name="Malcolm Thorpe">369642859871</x-zendesk-user> Here is the scripting I ended up using. In my scene I also had a text object for the volume amount and the name of the track. We have all the files living on a shared NAS that all of our machines connect to.
I also created a GPI that you can trigger while the file is playing. The GPI will add keyframes for the volume to fade out after 5 seconds. Let me know if I can help any way.
dim AudioFile as xpAudioFile
dim AudioFileName as xpBaseObject
Self.GetObjectByName("AudioFileName",AudioFileName)
if AudioFile.SetFileName("D:\Audio\" & AudioFileName.text) = true then
end if
dim eventTrack as xpSceneDirectorTrack
dim offlineEventClip as xpSceneDirectorClip
dim sceneDir as xpSceneDirector
Self.GetSceneDirectorByName("SceneDirector1",sceneDir)
sceneDir.GetTrackByName("Track1",eventTrack)
eventTrack.GetClipByName("OfflineEvent",offlineEventClip)
dim KeyFrameVol as xpBaseObject
dim AudioFileClip as xpSceneDirectorClip
dim AudioTrack as xpSceneDirectorTrack
dim posit as Long
dim value as Double
Self.GetObjectByName("Volume",KeyFrameVol)
posit = Clng(1)
value = Cdbl(KeyFrameVol.text)
sceneDir.GetTrackByName("Audio1",AudioTrack)
AudioTrack.GetClipByName("AudioFile1",AudioFileClip)
AudioFileClip.SetKeyFrame(posit,value)
' Set the offline clip at the end of the track
offlineEventClip.Position = AudioFileClip.Duration + 30
#XPression