Community Forums Archive

Go Back

Subject:Save WMA work around
Posted by: Ghent
Date:2/9/2007 10:38:33 PM

Hi. I'm making this posting because we ran into a confirmed SoundForge 8 bug that returns this error message when you try to save certain WMA files:
Error 0x00d0bc2 (message missing)
I'm not sure what the root of the problem is, and hopefully the next patch will have it fixed. But in the mean time here is a work around I am using because I couldn't wait for the patch.
The work around is a script that you can run. It will take a WAV file and save it as a WMA file.
The script requires that you have Windows Media Encoder 9 Series installed. You can download this here:
http://www.microsoft.com/downloads/details.aspx?familyid=5691ba02-e496-465a-bba9-b2f1182cdf24&displaylang=en
There is also a x64 bit version here:
http://www.microsoft.com/downloads/details.aspx?FamilyId=CC41218D-7E37-4546-BF0B-1276959EE3EF
(If you don't know what a x64 bit version is, get the other version)
You can find information on this program here:
http://www.microsoft.com/windows/windowsmedia/forpros/encoder/default.mspx

After you install this program run the Windows Media Profile Editor and create a profile with the encoding settings you want. Save the profile (a .prx file).
Now copy and paste the following script into the Sound Forges Script Editor. This is a VBScript. There are two lines you need to edit in the script. It's all documented, just read the REM Statements.
You have to have an open sound file that has been saved as a .WAV before you run the script. I hope this gets you back and running like it did me!

' VBScript

Imports System
Imports System.IO
Imports System.Windows.Forms
Imports SoundForge

' This script requires this dependency to run the shell command.
Imports Microsoft.VisualBasic


Public Class EntryPoint
Public Function Begin(app as IScriptableApp)

Dim procID As Double
'There are explained below.
Dim ProfilePath As String
Dim FileNameSuffix As String
FileNameSuffix = ""
Dim CScriptPath As String
Dim WMcmdPath As String
Dim FileInPath As String
Dim FileOutPath As String


' ************** Just set these two **************
' * Start Here * parameters and * Start Here *
' ************** you're good to go! **************

' This is the path to the Windows Media Profile .prx file
' that you created using the Windows Media Profile Editor.

ProfilePath ="C:\Program Files\Windows Media Components\encoder\Profiles\Voice9_16kbps.prx"

' The file suffix is added to the name of the file.
' You can leave this variable set to "" or REM it out.
' If you want the file to end in "Complete" or "Ready"
' enter it here. You can also get creative and use
' things like time. But it must be a given in a string format.

FileNameSuffix = "Voice9"

' ********************************************************
' * Save your file as a .WAV before you run this stript. *
' ********************************************************


' ***********************************************************************
' *** That should be all you need, but some computers have their ***
' *** files located in some place other than the default location. ***
' *** If this means you, correct the two additional parameters below. ***
' ***********************************************************************

' Location of the CScript.exe file.
' To test this path, copy and paste it into a DOS/CMD prompt.
CScriptPath = "C:\Windows\system32\CScript.exe"

' Location of the Windows Media WMcmd.vbs file
WMcmdPath = "C:\Program Files\Windows Media Components\encoder\WMcmd.vbs"

' ********************************************************
' * That's all you need to configure. Just remember to *
' * save your file as a .WAV before you run this stript. *
' ********************************************************

' The path and name of the file to be encoded (The .WAV file)
FileInPath = App.CurrentFile.Filename

' The path and name of the file to be saved.
' If you want the file to go into the same directory as the wav, use this line:
FileOutPath = App.CurrentFile.Filename.Remove(App.CurrentFile.Filename.Length - 4, 4) & FileNameSuffix & ".wma"
' This removes the ".wma" at the end, puts our suffix in (if any) and adds the ".wma" again.

' Or you can make your own if you want it to go into a special directory
' FileOutPath =


' This adds Quote marks around all the paths. This is required if the path has a space,
' like "Program Files".
ProfilePath = Chr(34) & ProfilePath & Chr(34)
CScriptPath = Chr(34) & CScriptPath & Chr(34)
WMcmdPath = Chr(34) & WMcmdPath & Chr(34)
FileInPath = Chr(34) & FileInPath & Chr(34)
FileOutPath = Chr(34) & FileOutPath & Chr(34)

' Debug line. You can paste the output into a DOS/CMD prompt to help you debug.
App.OutputText(CScriptPath & _
" " & WMcmdPath & _
" -input " & FileInPath & _
" -output " & FileOutPath & _
" -Loadprofile " & ProfilePath)

'This executes the command. procID is the Processor ID
' (you can see this in your TaskManager).
' It can be used to manipulate the window that CScript.exe opens in.
procID = Shell(CScriptPath & _
" " & WMcmdPath & _
" -input " & FileInPath & _
" -output " & FileOutPath & _
" -Loadprofile " & ProfilePath, AppWinStyle.NormalFocus)

' Syntax Referance
' Cscript.exe WMcmd.vbs -input %Paramater% -Output %Parameter% -Loadprofile Profiles\9Voice_16Kbps.prx

End Function

Function FromSoundForge(app as IScriptableApp)
ForgeApp = app
app.SetStatusText(String.Format("Script '{0}' is running.", Script.Name))
Begin(app)
app.SetStatusText(String.Format("Script '{0}' is done.", Script.Name))
End Function
Public ForgeApp as IScriptableApp
Public Function DPF(sz)
ForgeApp.OutputText(sz)
End Function
Public Function DPF(sz,o)
ForgeApp.OutputText(System.String.Format(sz,o))
End Function
Public Function DPF(sz,o,o2)
ForgeApp.OutputText(System.String.Format(sz,o,o2))
End Function
Public Function DPF(sz,o,o2,o3)
ForgeApp.OutputText(System.String.Format(sz,o,o2,o3))
End Function

End Class 'EntryPoint

' End of Script

Message last edited on2/9/2007 11:02:00 PM byGhent.
Subject:RE: Save WMA work around
Reply by: Ghent
Date:2/9/2007 10:40:46 PM

I didn't have a chance to test this version of the script out, so if there is a syntax error, let me know.
Also, if someone wants to take the time to add some user interface to this, or some error checking (like making sure the file has been saved as a .WAV) go ahead and post an update!

Subject:RE: Save WMA work around
Reply by: Ghent
Date:3/1/2007 9:33:20 PM

I found some more infomation on this problem. Apparently it's a bug in a Windows Media Player 11 module that effects other audio software as well:
http://www.goldwave.ca/forums/viewtopic.php?p=7070&sid=58aec05a9699ac65ba702c97a1832a4b

Go Back