title
Products            Buy            Support Forum            Professional            About            Codec Central
 

Scripting Problem with AddFromToFiles()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarkP

    • Aug 2002
    • 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();
    %>
  • Spoon
    Administrator
    • Apr 2002
    • 44510

    #2
    I would try first:

    dMC.AddFromToFiles( "C:\afile.mp3", ".wav" );
    Spoon
    www.dbpoweramp.com

    Comment

    • MarkP

      • Aug 2002
      • 2

      #3
      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

      Comment

      • Spoon
        Administrator
        • Apr 2002
        • 44510

        #4
        Try the VB script code if you can, it might be something to do with Java.
        Spoon
        www.dbpoweramp.com

        Comment

        Working...

        ]]>