WMEncoder.PrepareToEncode
The PrepareToEncode method prepares the encoding process for starting.
Syntax
WMEncoder.PrepareToEncode(bPrepare)
Parameters
bPrepare
[in] Boolean indicating whether to initiate an encoding session.
Return Values
This method does not return a value.
Remarks
The WMEncoder.Start method calls PrepareToEncode before starting to encode. If the bPrepare parameter is True, a new encoding session is created for the defined configuration. If bPrepare is False, all opened source streams are closed and the encoding session is ended.
You can use the PrepareToEncode method to verify that the encoding process is ready before you call the Start method. For example, PrepareToEncode will indicate if the specified port is not available, or a device is not ready, and so on. You can also use this method to switch between source groups, thereby minimizing rendering delays for the end user.
Example Code
' Create a WMEncoder object.
Dim Encoder As WMEncoder
Set Encoder = New WMEncoder
' Load a predefined configuration. Configuration files
' have a .wme extension.
Encoder.Load ("C:\filename.wme")
' Initialize the encoding session.
Encoder.PrepareToEncode True
' Close any active source streams and end the
' encoding session.
Encoder.PrepareToEncode False
Requirements
Reference: Windows Media Encoder
Library: wmenc.exe
See Also