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

Thread: converting multiple files with dmcscriptinglib

  1. #1

    Join Date
    Aug 2011
    Posts
    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.

  2. #2
    Administrator
    Join Date
    Apr 2002
    Posts
    43,859

    Re: converting multiple files with dmcscriptinglib

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

  3. #3

    Join Date
    Aug 2011
    Posts
    10

    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

  4. #4
    Administrator
    Join Date
    Apr 2002
    Posts
    43,859

    Re: converting multiple files with dmcscriptinglib

    You are creating the converter objects in the separate threads?

  5. #5

    Join Date
    Aug 2011
    Posts
    10

    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.

  6. #6

    Join Date
    Aug 2011
    Posts
    10

    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.

  7. #7
    Administrator
    Join Date
    Apr 2002
    Posts
    43,859

    Re: converting multiple files with dmcscriptinglib

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

Posting Permissions

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