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

WMEncoderLib NullReferenceException???

P: n/a

When i try to run a piece of code which encodes a file via my
application i get a NullReferenceException. I have a vb component called
AudioEncoder.vb which contains the function. From my aspx page i make this
object and call the function EncodeAudioFile(). For some reason i am unable
to instantiate the WMEncoder object from within the EncodeAudioFile()
function even though I called the New keyword on it. The error occurs when I
call myEncoder.start(). Most of the code was taken straight from the Windows
Media Encoder SDK. Below is my code. Please help!!!

' Encode the audio file and save it to the artist directory

Response.Write(encoder.EncodeAudioFile(userName, "0004", stagingFile,
artistName, txtTrackDescription.Text, txtTrackName.Text))

Public Function EncodeAudioFile(ByVal userName As String, _

ByVal trackID As String, _

ByVal fileName As String, _

ByVal author As String, _

ByVal description As String, _

ByVal title As String) As Boolean

Dim returnValue As Boolean

Dim myEncoder As WMEncoder = New WMEncoder


// some initialization ...

' Start the encoding process.

myEncoder.Start() <--- error happens here. NullReferenceException

/// cleanup...
Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.