IWMEncOutputStats.DroppedSampleCount

Windows Media Encoder SDK banner art

The DroppedSampleCount property retrieves the number of media samples dropped since the encoding session was started.

Syntax

WMENC_LONGLONG = IWMEncOutputStats.DroppedSampleCount

Parameters

This property takes no parameters.

Property Value

A WMENC_LONGLONG containing the number of samples dropped.

Remarks

This property is read-only.

The WMENC_LONGLONG data type is a typedef from the CURRENCY type. A 64-bit integer is needed to hold the count, and CURRENCY is the only 64-bit integer type that Automation supports. 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 count, you must multiply the return value by 10,000.

Example Code

' Create a WMEncoder object.
Dim Encoder As WMEncoder
Set Encoder = New WMEncoder

' Retrieve an IWMEncStatistics object.
Dim Stats As IWMEncStatistics
Set Stats = Encoder.Statistics

' You must manually configure the encoding session or load
' a configuration from a file. For an example, see the
' IWMEncFile object.

' Retrieve an IWMEncOutputStats object from the
' IWMEncStatistics object.
Dim OutputStats As IWMEncOutputStats
Set OutputStats = Stats.StreamOutputStats(WMENC_AUDIO, 0, 0)

' You can create a timer control to retrieve the statistics
' (as follows) after you start the encoding session.
Dim lAvgBitrate As Long
Dim lAvgSampleRate As Long
Dim lByteCount As WMENC_LONGLONG
Dim lCurrentBitRate As Long
Dim lCurrentSampleRate As Long
Dim lDroppedByteCount As WMENC_LONGLONG
Dim lDroppedSampleCount As WMENC_LONGLONG
Dim lExpectedBitRate As Long
Dim lExpectedSampleRate As Long
Dim lSampleCount As WMENC_LONGLONG

lAvgBitrate = OutputStats.AverageBitrate
lAvgSampleRate = OutputStats.AverageSampleRate
lByteCount = OutputStats.ByteCount * 10000
lCurrentBitRate = OutputStats.CurrentBitrate
lCurrentSampleRate = OutputStats.CurrentSampleRate
lDroppedByteCount = OutputStats.DroppedByteCount * 10000
lDroppedSampleCount = OutputStats.DroppedSampleCount * 10000
lExpectedBitRate = OutputStats.ExpectedBitrate
lExpectedSampleRate = OutputStats.ExpectedSampleRate
lSampleCount = OutputStats.SampleCount * 10000

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also