WMEncoder.Archive
The Archive method starts, pauses, or stops the archiving process.
Syntax
void WMEncoder.Archive(
WMENC_ARCHIVE_TYPE enumArchiveType,
WMENC_ARCHIVE_OPERATION enumArchiveOp
);
Parameters
enumArchiveType
[in] Member of a WMENC_ARCHIVE_TYPE enumeration type indicating where encoded content is stored.
enumArchiveOp
[in] Member of a WMENC_ARCHIVE_OPERATION enumeration type indicating the archiving state.
Return Values
If this method fails, it returns an error number.
Number | Description |
0xC00D1B7F | This method cannot be called if the encoder engine is stopped. |
0xC00D1B77 | You can only save encoded content to a local file. |
0xC00D1B78 | You can only start, stop, or pause the archiving process. |
Remarks
You can use the Archive method to override the WMEncoder.EnableAutoArchive property and IWMEncSourceGroup.get_AutoArchive method. If both of these are set to true, archiving automatically starts when encoding of the relevant source group starts.
Example Code
using WMEncoderLib;
try
{
// Create a WMEncoder object.
WMEncoder Encoder;
Encoder = new WMEncoder();
// Load a predefined configuration from a file. The
// file name extension must be .wme.
Encoder.Load("C:\\filename.wme");
// Start the encoding process.
Encoder.Start();
// Start the archiving process.
Encoder.Archive(WMENC_ARCHIVE_TYPE.WMENC_ARCHIVE_LOCAL, WMENC_ARCHIVE_OPERATION.WMENC_ARCHIVE_START);
}
catch (Exception e)
{
// TODO: Handle exceptions.
}
Requirements
Reference: Windows Media Encoder
Namespace: WMEncoderLib
Assembly: Interop.WMEncoderLib.dll
Library: WMEncoderLib.dll
See Also