title
Products            Buy            Support Forum            Professional            About            Codec Central
 

Commandline CD Ripper

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Elens

    • Jul 2008
    • 4

    Commandline CD Ripper

    I'am developping a Delphi program in order to ripp about 500 classical CD's to Apple Lossless format.
    The Idea is to create a map for each CD an put the converted tracks therein with my standard naming for each piece of music and each track.
    I got support from Mr Spoon to formulate the commandline which allowed me to rip tracks in the planned way by manually input in the cMD form
    However if I put together the command in my program each command is rejected with error code 123. I believe the problem is in the way I formulate the command with single and double quotes. Since that area is note my strength, I would like to get some support to finish my program. I give you the relevant portions of my program:

    1. ExecAndWait function:

    function TfmMM_PARip.ExecAndWait(sExe, sCommandLine: string): Boolean;
    var
    dwExitCode: DWORD;
    tpiProcess: TProcessInformation;
    tsiStartup: TStartupInfo;
    begin
    showmessage('Opdracht = ' + sExe +lf+
    'Parameters = ' + sCommandline);
    Result := False;
    FillChar(tsiStartup, SizeOf(TStartupInfo), 0);
    tsiStartup.cb := SizeOf(TStartupInfo);
    if CreateProcess(PChar(sExe), PChar(sCommandLine), nil, nil, False, 0,
    nil, nil, tsiStartup, tpiprocess) then
    begin
    if WAIT_OBJECT_0 = WaitForSingleObject(tpiProcess.hProcess, INFINITE) then
    begin
    if GetExitCodeProcess(tpiProcess.hProcess, dwExitCode) then
    begin
    if dwExitCode = 0 then
    Result := True
    else
    SetLastError(dwExitCode + $2000);
    end;
    end;
    dwExitCode := GetLastError;
    CloseHandle(tpiProcess.hProcess);
    CloseHandle(tpiProcess.hThread);
    SetLastError(dwExitCode);
    end;
    end;

    2. preparation code

    for i := 1 to DbTrk do
    begin
    with dmMMDm.taRipDb do
    begin
    indexfieldnames := 'Drgr_Code;Trck_Numm';
    Trck := PadN(inttostr(i),3);
    if not findkey([Drgr_Code,Trck]) then
    Naam := Trck + ' niet gevonden'
    else
    Naam := fieldbyname('MzDl_Naam').asstring
    end;
    Src := 'Track' + Padn(inttostr(i),2) + '.cda';
    Tgt := 'A:\ripped\';
    Path := '"C:\Program Files\dBpoweramp\Coreconverter.exe"';
    Parm := '--infile=' + '"H:\' + Src + '" ' +
    '--outfile=' + '"' + Tgt + Naam + '.m4a" ' +
    '--convert_to=' + '"m4a FDK (AAC)"';

    Ripd := ExecAndWait(pchar(Path),pchar(Parm));
    if Ripd then
    else begin
    showmessage('Error code ' + inttostr(GetLastError));
    end;
    end;

    3. The program does "ripp" all tracks but with errorcode 123, so no real ripp is done


    Thanks in advance

    Chris Elens
  • Spoon
    Administrator
    • Apr 2002
    • 44598

    #2
    Re: Commandline CD Ripper

    Open dBpoweramp Configuration, on the Music Converter tab enable the debug option, run your program to rip 1 track, then paste the debug log shown.
    Spoon
    www.dbpoweramp.com

    Comment

    • Chris Elens

      • Jul 2008
      • 4

      #3
      Re: Commandline CD Ripper

      Dear Mr Spoon
      I did change the debug option, but didn't notice any change in presenting the error

      Comment

      • Spoon
        Administrator
        • Apr 2002
        • 44598

        #4
        Re: Commandline CD Ripper

        if you look in the %tmp% folder, you should find files starting DBG______.tmp.txt
        Spoon
        www.dbpoweramp.com

        Comment

        • Chris Elens

          • Jul 2008
          • 4

          #5
          Re: Commandline CD Ripper

          I finally succeeded to find the proper formulation of the commandline.
          So My program worked with an old DVD Drive.
          I transferred the software to another computer with a BR Drive.
          All conversions are skipped, without giving any comment.

          The suggestion You did (to swith the debug option on) didn't change
          anything and I could not find an errorlog.
          What can I do for this problem?

          I tryed to rip manually with the Rip programdid work as allways.
          please help me out.

          Comment

          Working...

          ]]>