Share via


IWMEncAudienceObj.AudioCodec

Windows Media Encoder SDK banner art

The AudioCodec property specifies and retrieves the index of the audio codec that is used by the current audience.

Syntax

IWMEncAudienceObj.AudioCodec(iRenderSiteIndex) = Long
Long = IWMEncAudienceObj.AudioCodec(iRenderSiteIndex)

Parameters

iRenderSiteIndex

[in]  Integer containing the audience stream index. Because an audience can only contain one stream of each type, iRenderSiteIndex must be zero.

Property Value

A Long that indicates the index of the audio codec.

Remarks

This audio codec index corresponds to the total number of audio codecs that the profile supports for its VBR mode, which you can retrieve using the WMEncProfile2.AudioCodecCount property.

Use the WMEncProfile2.EnumAudioCodec method to retrieve the name of the audio codec and its FOURCC value.

Example Code

' Create a WMEncProfile2 object.
  Dim Pro As WMEncProfile2
  Set Pro = New WMEncProfile2

' Load a custom profile. REPLACE THE FILE NAME.
  Pro.LoadFromFile "C:\Profiles\CustomProfile.prx"

' Create an IWMEncAudienceObj object, selecting the first audience (0)
' in the profile.
  Dim Audnc As IWMEncAudienceObj
  Set Audnc = Pro.Audience(0)

' Retrieve the index of the audio codec that is used by the current
' audience.
  Dim lAudCodec As Long
  lAudCodec = Audnc.AudioCodec(0)

' Using the audio codec index, retrieve its name and FOURCC value.
  Dim lAud4cc As Long, vAudCodecName As Variant
  lAud4cc = Pro.EnumAudioCodec(lAudCodec, vAudCodecName)

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also