title
Products            Buy            Support Forum            Professional            About            Codec Central
 

Scripting Clarification

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KJim
    • May 2006
    • 36

    Scripting Clarification

    Hi,

    Could you post some info here about scripting for your different codecs? For example, I am successfully scripting using the "mp3 (Lame)" codec, but cannot seem to get there with the "AAC (Advanced Audio Compression)" codec, and these forums are very light on scripting help...

    For example, this VBS works fine:
    Code:
    Set dMC = CreateObject("dMCScripting.Converter")
    Call dMC.Convert("C:\inputfile.flac", "C:\outputfile.mp3", "mp3 (Lame)", "-b=128", "")
    ...but this doesn't:

    Code:
    Set dMC = CreateObject("dMCScripting.Converter")
    Call dMC.Convert("C:\inputfile.flac", "C:\outputfile.aac", "AAC (Advanced Audio Compression)", "-cbr 256000", "")
    ...neither does this:

    Code:
    Set dMC = CreateObject("dMCScripting.Converter")
    Call dMC.Convert("C:\inputfile.flac", "C:\outputfile.wma", "Windows Media Audio 9  Release 1 (WMA Pro 9)", "", "")
    I know this is probably because I am not using the CompressionCLI fields properly, which is why some info on these forums would be very much appreciated.

    You know what would be ace: an example of a "Call dMC.Convert..." statement for each codec. That would sort it!

    Cheers!
    J
  • Spoon
    Administrator
    • Apr 2002
    • 43900

    #2
    Re: Scripting Clarification

    Your best bet is to use cd ripper to set the settings you need then look in the reqistry for the command line, HKCU\Software\Illustrate\dbpoweramp\cdripper\profi les
    Spoon
    www.dbpoweramp.com

    Comment

    • KJim
      • May 2006
      • 36

      #3
      Re: Scripting Clarification

      Thanks for the response Spoon. Having ripped with my desired settings, the reg entry "CodecCLI_AAC (Advanced Audio Compression)" says:
      Code:
       -cli_encoder="C:\Program Files\Illustrate\dBpowerAMP\encoder\AAC (Advanced Audio Compression)\neroAacEnc.exe" -cli_cmd="-cbr 256000 -ignorelength -hinttrack -if - -of [outfile].tmp" -selection="2,13,0"
      Assuming that the input-file and output-file settings are taken care of by the quoted filenames, I've used this script:

      Code:
       Set dMC = CreateObject("dMCScripting.Converter")
      
      Call dMC.Convert("C:\inputfile.flac", "C:\outputfile.aac", "AAC (Advanced Audio Compression)", "-cli_encoder C:\Program Files\Illustrate\dBpowerAMP\encoder\AAC (Advanced Audio Compression)\neroAacEnc.exe -cbr 256000 -if [infile] -of [outfile]", "C:\encodingerrors.txt")
      ...but it doesn't work- no output. encodingerrors.txt says "Error [outfile] not specified on command line."

      Help!

      Comment

      • Spoon
        Administrator
        • Apr 2002
        • 43900

        #4
        Re: Scripting Clarification

        Try

        Set dMC = CreateObject("dMCScripting.Converter")

        Call dMC.Convert("C:\inputfile.flac", "C:\outputfile.aac", "AAC (Advanced Audio Compression)", "-cli_encoder={qt}C:\Program Files\Illustrate\dBpowerAMP\encoder\AAC (Advanced Audio Compression)\neroAacEnc.exe{qt} -cli_cmd={qt}-cbr 256000 -ignorelength -hinttrack -if - -of [outfile].tmp{qt}", "C:\encodingerrors.txt")
        Spoon
        www.dbpoweramp.com

        Comment

        • KJim
          • May 2006
          • 36

          #5
          Re: Scripting Clarification

          Same thing: Error [outfile] not specified on command line.

          Comment

          • Spoon
            Administrator
            • Apr 2002
            • 43900

            #6
            Re: Scripting Clarification

            My visual basic is a bit rusty try:


            Call dMC.Convert("C:\inputfile.flac", "C:\outputfile.aac", "AAC (Advanced Audio Compression)", "-cli_encoder="""C:\Program Files\Illustrate\dBpowerAMP\encoder\AAC (Advanced Audio Compression)\neroAacEnc.exe""" -cli_cmd="""-cbr 256000 -ignorelength -hinttrack -if - -of [outfile].tmp"""", "C:\encodingerrors.txt")
            Spoon
            www.dbpoweramp.com

            Comment

            • KJim
              • May 2006
              • 36

              #7
              Re: Scripting Clarification

              Almost! In the end, this worked:

              Code:
              Call dMC.Convert("C:\inputfile.flac", "C:\outputfile.aac", "AAC (Advanced Audio Compression)", "-cli_encoder=""C:\Program Files\Illustrate\dBpowerAMP\encoder\AAC (Advanced Audio Compression)\neroAacEnc.exe"" -cli_cmd=""-cbr 256000 -ignorelength -hinttrack -if - -of [outfile].tmp""", "C:\encodingerrors.txt")
              I now have flac to aac scripted encoding... thanks Spoon! One thing though- it just encodes silently in the background...how would I get it to display a progress bar?

              Comment

              • Spoon
                Administrator
                • Apr 2002
                • 43900

                #8
                Re: Scripting Clarification

                Progress bars are very difficult, I do not think you could access it from Visual Basic.
                Spoon
                www.dbpoweramp.com

                Comment

                • KJim
                  • May 2006
                  • 36

                  #9
                  Re: Scripting Clarification

                  I guess what I want to know is: how can I do, in r12, what I used to do in r11? Our systems rely on my scripting the output of DMC to produce files encoded to various formats... it used to be so easy! I used to just replace the codec name in the script, add that I would like to see the options dialog before starting encoding, run the vbs, set the options in the dialog, and hey presto! Surely it can still be done!?

                  Comment

                  • LtData
                    dBpoweramp Guru
                    • May 2004
                    • 8288

                    #10
                    Re: Scripting Clarification

                    There is an example on the scripting page (http://www.dbpoweramp.com/developer-scripting-dmc.htm) that gives code on how to show the compression settings dialog when your encoding via scripting.

                    Comment

                    • KJim
                      • May 2006
                      • 36

                      #11
                      Re: Scripting Clarification

                      Yes, that's the scripting help file which I was saying is too vague- if the convert call is placed before the settings dialog call, the file just converts and the dialog is displayed after. If the opposite is true, the dialog is shown, then the file is converted after you press ok, but all options changed in the dialog are ignored...

                      I just need to know how to pass a dynamically generated list of files to convert to dmc, the equivalent of this r11 script, for example*:

                      Set dMC = CreateObject("dMCScripting.Converter")
                      dMC.VolumeNormalize = False
                      dMC.PreserveTags = True
                      dMC.DeleteSourceFiles = False
                      Set Mp3Settings = CreateObject("dMCScripting.Mp3Settings")
                      Call Mp3Settings.Set (128, 44100, 0, 0)
                      Call dMC.AddFromToFiles("J:\Artist\Title\01 - Track title.flac", "C:\audio\mp3\new_filename1")
                      Call dMC.AddFromToFiles("J:\Artist\Title\02 - Track title.flac", "C:\audio\mp3\new_filename2")
                      Call dMC.AddFromToFiles("J:\Artist\Title\03 - Track title.flac", "C:\audio\mp3\new_filename3")
                      Call dMC.AddFromToFiles("J:\Artist\Title\04 - Track title.flac", "C:\audio\mp3\new_filename4")
                      Call dMC.GoConversion("Mp3 (Lame)", False, True, True, False)

                      *I say for example because that's just one script- scripting from and to any format could be an example here...

                      Comment

                      • Spoon
                        Administrator
                        • Apr 2002
                        • 43900

                        #12
                        Re: Scripting Clarification

                        The options dialog returns a CLI string, that is passed to the compressor.
                        Spoon
                        www.dbpoweramp.com

                        Comment

                        • KJim
                          • May 2006
                          • 36

                          #13
                          Re: Scripting Clarification

                          Yep, that works a treat if you pass the CompressionCLI variable along:

                          Code:
                          Set dMC = CreateObject("dMCScripting.Converter")
                          Dim CompressionCLI
                          CompressionCLI = "-codec=""Windows Media Audio 9.2"" -settings=""128 kbps, 44 kHz, stereo CBR"""
                          CompressionCLI = dMC.ShowSettings("Windows Media Audio 9", CompressionCLI)
                          
                          Call dMC.Convert("J:\Audio\01 - sourcefile.flac", "C:\Converted\01 - convertedfile.wma", "Windows Media Audio 9", CompressionCLI, "C:\encodingerrors.txt")
                          ...BUT it just starts encoding silently in the background. I appreciate that as you said progress bars are difficult in VB, but surely when I click OK in the options window it should start the dmc 'converting...' window? And if I click 'Cancel' in the options window, shouldn't it cancel the conversion instead of going ahead anyway?

                          Comment

                          • Spoon
                            Administrator
                            • Apr 2002
                            • 43900

                            #14
                            Re: Scripting Clarification

                            CLI encoding does not use any sort of graphical interface, so no converting window.
                            Spoon
                            www.dbpoweramp.com

                            Comment

                            • KJim
                              • May 2006
                              • 36

                              #15
                              Re: Scripting Clarification

                              Ok thanks. I guess the answer to my question (how do I script in r12 as I did in r11, interfaces, progress bars and all) is that it's no longer possible.

                              Surely there must at least be a way of showing when the conversion is finished? As much as I enjoy the suspense of refreshing an explorer window to watch the filesize level out, it isn't very practical...

                              Comment

                              Working...

                              ]]>