By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,192 Members | 1,856 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,192 IT Pros & Developers. It's quick & easy.

PrepareToEncode Encoder SDK (push server) failed???

P: n/a

I m working on WEBRADIO Software. im using Windows media encoder 9 SDK
on Windows 2003 server using VB.NET.
My current scenario is my soundcard . My application will push my
server the live audio on specific port.

I am using Windows media encoder sdk sample (entire code), currently i
am facing problem in "PrepareToEncode" (Number Error: 0XC00D2F0C),
entire code is given below:

Imports WMEncoderLib
Public Class Form1
' Declare variables.
Dim WithEvents Encoder As WMEncoder
Dim SrcGrpColl As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup2
Dim SrcAud As IWMEncAudioSource
Dim SrcVid As IWMEncVideoSource
Dim ProColl As IWMEncProfileCollection
Dim Pro As IWMEncProfile
Dim PushDist As IWMEncPushDistribution
Dim strServerName As String
Dim strPubPoint As String
Dim strPubTemplate As String
Dim MyNSCFile As String
Dim MyNSCURL As String
Dim MyASXFile As String
Private Function Encoder_OnAcquireCredentials(ByVal strRealm As
String, ByVal strSite As String, ByVal varUser As Object, ByVal
varPassword As Object, ByVal lngFlags As Long) As Boolean
'strRealm = ""
'strSite = ""
varUser = "admin"
varPassword = "statesecret"
lngFlags = 2
End Function

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' Generate the announcement file.
PushDist.GenerateAnnouncementFile(MyNSCURL, MyASXFile)

' Start encoding.
MsgBox("Click OK to stop broadcasting.")
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' Create a WMEncoder object.
Encoder = New WMEncoder

' Retrieve the source group collection and add sources.
' Use the default devices for the audio and video sources.
SrcGrpColl = Encoder.SourceGroupCollection
SrcGrp = SrcGrpColl.Add("SG_1")


' Retrieve the profile collection. This example uses the 3rd
ProColl = Encoder.ProfileCollection
Pro = ProColl.Item(2)
SrcGrp.Profile = Pro

' Set up the push broadcast.
PushDist = Encoder.Broadcast

' Specify the push distribution variables, including the
Windows Media
' server name, publishing point, and announcement files.
' Provide real values for the following placeholders.
strServerName = ""
strPubPoint = "webradio"
strPubTemplate = "tmp_online"
MyNSCFile = ""
MyASXFile = ""

' Remove the publishing point when the broadcast is over.
PushDist.AutoRemovePublishingPoint = True

' Set the push distribution variables.
PushDist.ServerName = strServerName
PushDist.PublishingPoint = strPubPoint
PushDist.Template = strPubTemplate
End Sub
End Class

Could anybody please help me out.
Any hints/ ideas will be highly appreciated.

Oct 4 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.