title
Products            Buy            Support Forum            Professional            About            Codec Central
 
Results 1 to 4 of 4

Thread: Scripting Problem with AddFromToFiles()

  1. #1

    Join Date
    Aug 2002
    Posts
    2

    Scripting Problem with AddFromToFiles()

    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();
    %>

  2. #2
    Administrator
    Join Date
    Apr 2002
    Posts
    43,857
    I would try first:

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

  3. #3

    Join Date
    Aug 2002
    Posts
    2
    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

  4. #4
    Administrator
    Join Date
    Apr 2002
    Posts
    43,857
    Try the VB script code if you can, it might be something to do with Java.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •