WMEncoder.RecordingLevel

Windows Media Encoder SDK banner art

The RecordingLevel property specifies and retrieves the volume level of a specific audio source stream.

Syntax

WMEncoder.RecordingLevel(iIndex) = Long
Long = WMEncoder.RecordingLevel(iIndex)

Parameters

iIndex

[in]  Integer containing the index of the audio stream.

Property Value

A Long containing the volume level of the audio source specified by iIndex.

Remarks

You must set the iIndex parameter to 0 because multiple audio streams are not currently supported. The volume level is scaled to the actual level supported by the audio card, and must be between 0 and 100 inclusive. A value of 0 is the minimum volume the audio card supports and 100 is the maximum.

Note You can use this property only with audio devices. If setting this property fails, the audio card might not allow setting the recording level.

Example Code

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

' Declare objects and variables.
Dim SrcGrpColl As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup
Dim SrcAud As IWMEncSource

' Create an IWMEncSourceGroupCollection object.
Set SrcGrpColl = Encoder.SourceGroupCollection

' Create an IWMEncSourceGroup object.
Set SrcGrp = SrcGrpColl.Add("SG_1")

' Create an audio source object.
Set SrcAud = SrcGrp.AddSource(WMENC_AUDIO)

' Specify the .avi source file.
SrcAud.SetInput "C:\filename.avi"

' Retrieve the initial recording level from the device.
Dim lAudioLevel As Long
lAudioLevel = Encoder.RecordingLevel(0)

' Set the recording volume level.
Encoder.RecordingLevel(0) = 50

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also