title
Products            Buy            Support Forum            Professional            About            Codec Central
 

converting multiple files with dmcscriptinglib

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

    • Aug 2011
    • 10

    converting multiple files with dmcscriptinglib

    Can you provide a brief code snippet to show how to convert multiples simultaneously with dmcscriptinglib. I a have a quad-core machine, running windows 7 32bit. I create 4 objects....

    Converter dMC1 = new Converter();
    Converter dMC2 = new Converter();
    Converter dMC3 = new Converter();
    Converter dMC4 = new Converter();

    Next, I recurse through the files to be converted, an run each conversion on a separate thread.

    Task.Factory.StartNew(() => ConvertMusicFile(FromFile, ToFile));

    ...From ConvertMusicFile() .....................
    dMC1.Convert(fileFrom, fileTo, "mp3 (Lame)", "-b=" + m_BitRate, "");
    ............................
    While 4 threads may be running simultaneously, only I file at a time is converted. It appears as though multiple threads cannot access the converter at the same time.

    Thank you.
  • Spoon
    Administrator
    • Apr 2002
    • 44515

    #2
    Re: converting multiple files with dmcscriptinglib

    You could be better using the CLI object instead for multiple conversions, actually dBpoweramp does it this way.
    Spoon
    www.dbpoweramp.com

    Comment

    • rtmurphy

      • Aug 2011
      • 10

      #3
      Re: converting multiple files with dmcscriptinglib

      I would rather use the scripting com object. Given that, can multiple files be converted simultaneously? As I stated, when I create multiple objects, and run them on multiple threads, it only converts ONE FILE AT A TIME, eventhough all threads are active. Can you provide a quick code snippet showing how to convert multiple files simultaneously using the COM object.

      Thank you

      Comment

      • Spoon
        Administrator
        • Apr 2002
        • 44515

        #4
        Re: converting multiple files with dmcscriptinglib

        You are creating the converter objects in the separate threads?
        Spoon
        www.dbpoweramp.com

        Comment

        • rtmurphy

          • Aug 2011
          • 10

          #5
          Re: converting multiple files with dmcscriptinglib

          I have tried creating the converter objects globally within the class, and running the conversion on separate threads, and creating the objects within the method called by the thread factory.

          Comment

          • rtmurphy

            • Aug 2011
            • 10

            #6
            Re: converting multiple files with dmcscriptinglib

            Again. Can you provide a code snippet ( in C*blooper*) that shows how to convert multiple files simultaneously? Thank you.

            Comment

            • Spoon
              Administrator
              • Apr 2002
              • 44515

              #7
              Re: converting multiple files with dmcscriptinglib

              We have never done this kind of conversion, so I am not sure it is possible.
              Spoon
              www.dbpoweramp.com

              Comment

              Working...

              ]]>