Re: Windows Media Encoder in VB -- stopped working
- From: "Brandon Pai [msft]" <bpai@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 6 Apr 2005 10:48:33 -0700
The code looks correct. Can you still trim the file(s) that you were able to
a weeks ago? Maybe this is file-specific. Also, is the file duration greater
than cLength? It would be helpful to print out other events in
BasicEdit_OnStateChange to see how far it got.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
<deefresh@xxxxxxxxx> wrote in message
news:1112789105.596922.239710@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I have a VB project that I've been using to trim a bunch of WMA files,
> to create 2 minute sample files. I have been running the same code for
> over a month without incident, until yesterday when the code stopped
> creating the sample files without raising any errors.
>
> I have not installed any new dlls on my computer related to the encoder
> sdk, nor have I changed any security permissions. The code runs fine
> without any errors, but the sample file never actually gets created.
>
> Has anyone else ever had this problem with the Encoder? Any advice
> would be appreciated.
>
> Here is the code that I am using:
>
> Dim bDone As Boolean
> Dim WithEvents BasicEdit As WMEncBasicEdit
> Private Const cLength = "120000"
>
> Sub TrimSampleFile(FileIn As String, FileOut As String)
> On Error GoTo TrimErr
>
> ' Create the WMEncBasicEdit object.
> Set BasicEdit = New WMEncBasicEdit
> ' Specify the input and output files.
> BasicEdit.MediaFile = FileIn
> BasicEdit.OutputFile = FileOut
>
> ' Add indexing to the file.
> BasicEdit.Index = True
>
> BasicEdit.MarkIn = 0
> BasicEdit.MarkOut = cLength
>
> BasicEdit.start
>
> Do Until bDone = True
> DoEvents
> Loop
>
> Exit Sub
>
> TrimErr:
>
> MsgBox Err.Description & " " & Err.Number & " " & "TrimFile"
>
> End Sub
>
> ' This events procedure checks for the end of the editing process.
> Private Sub BasicEdit_OnStateChange(ByVal EnumState As _
> WMEncoderLib.WMENC_BASICEDIT_STATE)
> If EnumState = WMENC_BASICEDIT_STOPPED Then bDone = True
> End Sub
>
.
- References:
- Windows Media Encoder in VB -- stopped working
- From: deefresh
- Windows Media Encoder in VB -- stopped working
- Prev by Date: Re: Create default settings
- Next by Date: Re: Encoding Script Help Please
- Previous by thread: Windows Media Encoder in VB -- stopped working
- Next by thread: Create default settings
- Index(es):
Relevant Pages
|