IWMEncSource.Type
![]() |
The Type property retrieves the media stream type.
Syntax
WMENC_SOURCE_TYPE = IWMEncSource.Type
Parameters
This property takes no parameters.
Property Value
A member of the WMENC_SOURCE_TYPE enumeration that indicates the media type of the current source. This must be one of the following values.
| Value | Number | Description |
| WMENC_AUDIO | 1 | Identifies an audio stream. |
| WMENC_VIDEO | 2 | Identifies a video stream. |
| WMENC_SCRIPT | 4 | Identifies a text stream. |
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
Dim SrcVid As IWMEncVideoSource
Dim ProColl As IWMEncProfileCollection
Dim Pro As IWMEncProfile
Dim i As Integer
' Create an IWMEncSourceGroupCollection object.
Set SrcGrpColl = Encoder.SourceGroupCollection
' Create an IWMEncSourceGroup object.
Set SrcGrp = SrcGrpColl.Add("SG_1")
' Create an audio and a video source object.
Set SrcAud = SrcGrp.AddSource(WMENC_AUDIO)
Set SrcVid = SrcGrp.AddSource(WMENC_VIDEO)
' Loop through the collection of system profiles to set
' a specific profile into the source group object.
Set ProColl = Encoder.ProfileCollection
For i = 0 To ProColl.Count - 1
Set Pro = ProColl.Item(i)
If Pro.Name = "Windows Media Video 8 for Local Area Network (384 Kbps)") Then
SrcGrp.Profile = Pro
Exit For
End If
Next
' Specify live stream capture from the installed video
' and audio cards.
SrcVid.SetInput "DEVICE://Default_Video_Device"
SrcAud.SetInput("Device://Default_Audio_Device")
' Verify that the repeat property is turned off. This is
' the default.
SrcVid.Repeat = False
SrcAud.Repeat = False
' Start the encoding process 10 seconds after the source
' has started, and stop the encoding process 25 seconds
' after the source has started.
SrcVid.MarkIn = 10000
SrcAud.MarkIn = 10000
SrcVid.MarkOut = 25000
SrcAud.MarkOut = 25000
' Start the encoding process.
SrcGrp.PrepareToEncode (True)
Requirements
Reference: Windows Media Encoder
Library: wmenc.exe
See Also
.gif)