Hi,
When i try to run a piece of code which encodes a file via my asp.net
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
Dim enumState As WMENC_ENCODER_STATE
// some initialization ...
' Start the encoding process.
myEncoder.Start() <--- error happens here. NullReferenceException
/// cleanup...