IWMEncOutputStats.AverageSampleRate
![]() |
The AverageSampleRate property retrieves the average number of media samples encoded per second since the encoding session was started.
Syntax
Long = IWMEncOutputStats.AverageSampleRate
Parameters
This property takes no parameters.
Property Value
A Long containing the average sample rate in samples per second.
Remarks
This property is read-only.
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
.gif)