IWMEncFileArchiveStats.FileDuration

Windows Media Encoder SDK banner art

The FileDuration property retrieves the duration of the archive file.

Syntax

WMENC_LONGLONG = IWMEncFileArchiveStats.FileDuration

Parameters

This property takes no parameters.

Property Value

A WMENC_LONGLONG that indicates the duration of the output file.

Remarks

This property is read-only.

File duration is by-value, so its value does not change once it has been retrieved. Each time you want this value, you must retrieve an IWMEncFileArchiveStats object. File duration information does not persist after the encoding process has stopped.

The WMENC_LONGLONG data type is a typedef from the CURRENCY type. A 64-bit integer is needed to hold the size of the archive file, and CURRENCY is the only 64-bit integer type that Automation contains. However, CURRENCY is a fixed-point type that has the decimal point moved four places to the left. Therefore, to display the CURRENCY value as a true integer and retrieve the correct file size in milliseconds, you must multiply the return value by 10,000 (or by 10 to retrieve the size in seconds).

Example Code

' See the IWMEncFile object for an example that explains how to
' create and use an archive file.
' The following example shows how to capture archiving statistics
' during the encoding process.

' Declare objects and variables.
  Dim Stats As IWMEncStatistics
  Dim FileStats As IWMEncFileArchiveStats
  Dim lDuration As WMENC_LONGLONG
  Dim lSize As WMENC_LONGLONG

' Create an IWMEncStatistics object and retrieve
' the IWMEncFileArchiveStats object from it.
  Set Stats = Encoder.Statistics
  Set FileStats = Stats.FileArchiveStats

' Find the duration (seconds) and size (bytes) of the archive file.
  lDuration = FileStats.FileDuration * 10
  lSize = FileStats.FileSize * 10000

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also