I tried to add to my last post by coming up wiht the exact syntax for playing an external WAV file. I came up with the following, but I couldn't find the proper syntax for declaring the external API call. There needs to be a declaration, something like:
public FUNCTION PlaySound(String lpszName, long hModule, long dwFlags);
hey thanks! So I just need to figure out how to declare the external API call... any clue where I should start looking? I appreciate the help. At least I know what direction to head.
I was hoping someone else would chime in. Since I don't program regularly, I couldn't find the proper syntax. In Visual Basic, it is something like this, but I couldn't get it to work in jscript:
public FUNCTION PlaySound(String lpszName, long hModule, long dwFlags);
I think the DLL that contains this function must also be declared with a statement similar to:
[sysimport(dll="winmm.dll")]
but again, I couldn't figure out the right syntax to make this work in Vegas.
I'm not sure if you can do a DllImport in JScript but you should be
able to create a C# assembly that makes the call to PlaySound. Then
your script can import that assembly and call a function that calls
PlaySound.
There's some details on using custom assemblies from within a Vegas
script here:
Thanks for the link. I'd forgotton about their script tutorial. Unfortunately, it didn't seem to answer the question posed by the original poster.
I guess what you are saying is that Vegas scripts cannot make calls to any Windows APIs, unlike what I can do in Office Applications, as described here:
I'm working on a completely unrelated task, but discovered this method to play a sound. It ain't pretty, but it works. It requires that you have the SoundRecorder installed. If you don't, substitute the path and name of some other small applet that will play wav files.