Lua → VBScript SwxWare v13.10
This function returns the length of a given .wav file in seconds.
local nLength = PBXScript.GetAudioFileLength(sFileName)
This function returns a number value.
If 0 is returned, the file length is 0 or length could not be determined, e.g. because of an unsupported file format. SwyxWare requires .wav files in 16kHz, 16bit, mono format.
local nLength = PBXScript.GetAudioFileLength("Welcome.wav")
If no explicit path is given in sFileName, SwyxServer searches this file in the database, in the following scopes in that order:
- User Default
- System Default
local nLength = PBXScript.GetAudioFileLength("C:\Announcements\Welcome.wav")
It is also possible to use a local file from the SwyxServer machine. In this case it is necessary, that the Windows user account the SwyxServer service is running under (usually the SwyxServiceAccount), has read privileges on that file.