[FileNameSetNext,toolname.ztl]
[IPress,Tool:Load Tool]
ok Cool!!!
But what if we wanna Load and play a wave file?
here is a Zscript I found By Muvlo Redond that will allow user to play a wavefile…
// Muvlo Redond
// 20040409
Simple test of the new ZScript audio playback features in Z2
[IButton,"Play Sound","Click to load and play a WAV file",
[VarDef,filename,""] // Declare a variable to store the file's name in
[VarSet,filename, // Set the variable here, not in the VarDef, so that it will work without reloading the ZScript
[FileNameAsk, // Ask the user for the WAV file
[StrMerge,"WAV (*.wav)", // This bit here is because I don't know what the character
[StrFromAsc,124],"*.wav" // used in the documentation is, but I found the ASCII number
],,"Load audio file..." // with StrFromAsc...
]
]
[If,[StrLength,filename], // If the the user didn't click cancel to the Open dialog...
[MemCreateFromFile,AudioFile,filename] // Create a memory block and load the audio file
[SoundPlay,AudioFile,1] // Play the sound, pause at this point 'til the file is done playing
[MemDelete,AudioFile] // Delete the mem block
]
]
What I want is to have a folder full of audio clips, and at certain points in My Zscript, I que the .Wave file and it gives a playback of some boaring Over descriptive Dialog of what I just painted or modeled…
anyways, anyone know how to que/play a wave file from inside Zscript?
I am going to go and hack away at it for a while… If I get it, I will return here and Share my findings :)
also If end user has .OGG and .MP3 codecs, will we be able to use that format?
or is it plain old .WAV files only ?
I am trying to save bandwidth…
TIA for any help small_orange_diamond