|
|||
|
Hello,
I´m having troubles with reading a wav file through swfkit, because my wav file is in a http path. Previously I had the code like this: m.deviceType = "waveaudio"; m.fileName = ``c:\\audiofiles\test.wav''; m.command = "open"; m.command = ``play''; and it worked but now I want something like: m.deviceType = "waveaudio"; m.fileName = ``http://server.../file=x.wav''; m.command = "open"; m.command = ``play''; Do you know how can I resolve this problem? Thanks |
|
|||
|
You'll have to first download the wave file, save it into the local drive and then play it by using the MCI object. If you want to play it using http link, please use the windows media player control, or other media player controls like VLC, etc.
|
|
|||
|
Hello,
Thanks. I'm traing to download the file but I have some doubts: var url = "http://192.168.1.78:8089/FileServerFreeAccess?file=CALL_74011000.WAV" var temp = "C:\\temp" var ftp; --- What is this variable tipe? ftp.connect() ; --- do I need to connect and close? ftp.download(url, temp) ; ftp.onDownload = function (percent) { trace(percent + " of the file has been downloaded."); return true; } ftp.close(); |
|
|||
|
Quote:
Code:
var url = "http://192.168.1.78:8089/FileServerFreeAccess?file=CALL_74011000.WAV";
var temp = Shell.getSpecialFolder('temp');
// make a unique file name
var md5filename = temp + '\\' + Encryption.md5(url) + '.wav';
trace(md5filename);
var inet = new Inet;
if (inet.getUrl(url, md5filename)) {
var m = new MCI;
m.deviceType = "waveaudio";
m.fileName = md5filename;
m.command = 'open';
m.command = 'play';
}
// remove the temporary file when close the main window
getMainWnd().onClose = function () {
var f = new File(md5filename);
f.remove();
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|