PDA

View Full Version : Scripting Problem with AddFromToFiles()



MarkP
08-26-2002, 05:33 AM
Hi,

I'm writing a small app for my network at home, using IIS 5.0 on Win2k. I have a shared directory of MP3 files, encoded at 320k. The idea is to allow browsing of the MP3 folders via HTTP, and when a file is selected for download, to automatically use dMC to create a lower-bitrate version of the file suitable for playing on a PocketPC.

The only real problem that I have is that when I call the AddFromToFiles() method, it hangs up. I've attached an example which causes the problem when the AddFromToFiles() call is uncommented. As long as that line is commented out, the test page displays fine.

Any suggestions as to what might be going wrong? I'm using dMC version 9a.

Mark

<%@ LANGUAGE="javascript" %>
<%
Response.Cachecontrol = "no-cache";
Response.Addheader( "pragma", "no-cache" );
Response.Expires = -1;
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<%
var objFileSys = Server.CreateObject( "Scripting.FileSystemObject" );

var strFileName = Request.QueryString("FileName");
var nBitrate = 128;

var dMC = Server.CreateObject("dMCScripting.Converter");
Response.Write( "Created dMC Converter<br>" );

var objMp3Settings = Server.CreateObject("dMCScripting.Mp3Settings");
Response.Write( "Created MP3 settings<br>" );

objMp3Settings.Set( nBitrate, 44100, 0, 0 );
Response.Write( "Set MP3 params<br>" );

dMC.VolumeNormalize = false;
dMC.PreserveTags = false;
dMC.DeleteSourceFiles = false;
dMC.ConvertToFolder = false;
Response.Write( "Set conversion params<br>" );

Response.Write( "Adding file for conversion: " + strFileName + " to " + Server.MapPath( "." ) + "squish" + "<br>" );
// dMC.AddFromToFiles( strFileName, Server.MapPath( "." ) + "squish" );

// dMC.GoConversion( "Mp3 (Blade)", true, true, true, true);

%>

</BODY>
</HTML>
<%
Response.End();
%>

Spoon
08-26-2002, 06:14 AM
I would try first:

dMC.AddFromToFiles( "C:\afile.mp3", ".wav" );

MarkP
08-27-2002, 01:35 AM
Hi Spoon,

Thanks for the quick reply. I tried what you suggested, but it's just the same. I'll try and gather some more information.

BTW, I tried using the AddFromFile() method instead, and got the same problem.

I like the scripting features, but I can't see what's going wrong here.

Mark

Spoon
08-27-2002, 02:40 AM
Try the VB script code if you can, it might be something to do with Java.