Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-13-2009, 12:48 PM
Junior Member
 
Join Date: Mar 2009
Posts: 3
Unhappy Reading a wav file from a http:\\ path

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
Reply With Quote
  #2 (permalink)  
Old 03-17-2009, 10:47 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default

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.
Reply With Quote
  #3 (permalink)  
Old 03-24-2009, 10:26 AM
Junior Member
 
Join Date: Mar 2009
Posts: 3
Cool

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();
Reply With Quote
  #4 (permalink)  
Old 03-24-2009, 11:28 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default

Quote:
Originally Posted by rneves View Post
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();
It seems that you're playing a http file, so don't use ftp. You can do like this
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();
}
Reply With Quote
  #5 (permalink)  
Old 03-24-2009, 03:55 PM
Junior Member
 
Join Date: Mar 2009
Posts: 3
Smile Thank you

It´s working
Thanks
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:30 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.