title
Products            Buy            Support Forum            Professional            About            Codec Central
 
  Scripting dBpoweramp Music Converter
 
Most functionality of Music Converter can be scripted: conversions, reading / writing ID Tags and reading audio file properties (such as bit rate, etc). Scripting can be controlled from any COM aware programs, or a program written in c++, .NET, Visual Basic scripting even web based scripting.

In-house Scripting License:  A dBpoweramp Reference license is required for each PC & concurrent scripting object. For example 1 PC handles scripting, it is a dual cpu system and 2 scripting objects are used side by side, 2 Reference licenses are required.

Supplied as part of another Program:  Email your requirements.

Release 12 or newer of Music Converter is required, older versions of Music Converter had a different scripting library, see the previous version compatibility section.

  Using Music Converter  

 
Music Converter is controlled through a COM object called dMCScripting. See examples provided at the end of this section on how to access this object in various languages.
 
Functions:

Converts one file:  .Convert ([in] BSTR FromFile, [in] BSTR ToFile, [in] BSTR Compression, [in] BSTR CompressionCLI, [in] BSTR ErrorFile) 

FromFile:    Source filename (note all filenames must include a full path, ie c:\file.mp3).
T
oFile:    Destination filename, existing file overwritten, folders are not automatically created.
               Note: Extension automatically added to ToFile on 32 bit Windows, but not on 64 bit Windows
Compression:    Audio format encoding to ( such as mp3 (Lame) ).
CompressionCLI:    Compression settings passing to encoder, see CoreConverter command line documentation.
ErrorFile:   Pass a filename, this file will receive any conversion errors. If there are no errors this file will remain 0 bytes. Pass "" if no error file is required.

DSP effects can also be activated, pass them in CompressionCLI, see command line documentation.

Read ID Tag from File: .ReadIDTag ([in] BSTR File, [in] long Index, [out] BSTR *pTagElement,  [out] BSTR *pTagValue )

File:    Source filename.
Index
:    Pass 0, 1, 2... until pTagElement returns ""
pTagElement:    Returns Tag element, or "" when finished.
pTagValue
:    Returns Tag Value.

Note this method is not compatible with VBScripting, instead use ReadIDTagElementValue
 

Read ID Tag from File: .ReadIDTagElementValue ([in] BSTR File, [in] long Index, [out, retval] BSTR *pTagElementValue )

File:    Source filename.
Index
:    Pass 0, 1, 2... until pTagElementValue returns ""
pTagElementValue:    Returns "Element: Value", or "" when finished.

Note requires dBpoweramp R13 or above.

Write ID Tag to File: .WriteIDTag ([in] BSTR File, [in] BSTR Element,  [in] BSTR Value )

File:    Source filename.
Element:    Tag element to set, such as Artist.
Value
:    Tag Value to set.
 

Show Compression Settings Dialog: .ShowSettings ([in] BSTR Compression, [in] BSTR InCompressionCLI,  [out, retval] BSTR *OutCompressionCLI )

Compression:    Audio format.
InCompressionCLI:    Existing compression settings passing to setting page, from previous edit, pass "" first time.

Returns the user chosen compression CLI string, ready to be passed to .Convert
Note does not function on 64 bit Windows
 

Read Audio Properties from File: .AudioProperties ([in] BSTR File, [out, retval] BSTR *OutProps )

File:    Source filename.

Returns a string containing audio properties.

 Scripting Code Examples  

 
Example scripting code for:

C++     additional include files:  dMCScripting.c   dMCScripting.h

.NET c#

.NET Visual Basic

Windows Scripting Host VB Script

Note: Projects should be built to include Common Controls v6 (otherwise an error about missing ordinal will be found). VB scripting prior to Windows 10 is unlikely to function with common controls v6.