PDA

View Full Version : Converting any file - using example vb script...



higgsy
12-14-2003, 01:00 PM
Hi,

After looking at the example as below, it looks relatively easy to convert an audio file using the COM object. What i dont understand though is the example script is converting a file to a .WAV file, however the sscript never calls the WAVE sub object like so - Set WaveSettings = CreateObject("dMCScripting.WaveSettings"), so when do u ever make a call to these sub objects???

' Create dMC Object
Set dMC = CreateObject("dMCScripting.Converter")

' Set My options (Volume norm off, ID Tag Preservation On, No delete Source files)
dMC.VolumeNormalize = False
dMC.PreserveTags = True
dMC.DeleteSourceFiles = False

' Set Output Folder (to C:\Conversion123 )
dMC.ConvertToFolder = True
dMC.ToFolder = "C:\Conversion123"

' Add My Files to Convert
Call dMC.AddFromFile("C:\AudioFile1.mp3")
Call dMC.AddFromFile("C:\AudioFile2.mp3")

' Convert To Wave (No option page, Want Overwrite page, Want finished, Want Errors)
Call dMC.GoConversion("Wave", True, False, False, False)



If i wanted to convert a file to MP3 for example, should i run the following script before calling the dmc.GoConversion

Set Mp3Settings = CreateObject("dMCScripting.Mp3Settings")
Call Mp3Settings.Set (160, 44100, 0, 0)

Thanks in advance

Al :smile2:

Spoon
12-14-2003, 07:06 PM
You dont need to specify the settings (it will use the last settings, when a user not scripting last set either Wave or Mp3 settings).