Re: Windows Media Encoder in VB -- stopped working

Tech-Archive recommends: Speed Up your PC by fixing your registry



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
>


.



Relevant Pages

  • Windows Media Encoder in VB -- stopped working
    ... creating the sample files without raising any errors. ... Dim WithEvents BasicEdit As WMEncBasicEdit ... Sub TrimSampleFile ... On Error GoTo TrimErr ...
    (microsoft.public.windowsmedia.encoder)
  • Re: Handle Worked - can someone please double check
    ... change the behavior of the trim ... ... Public Class myTextBox ... Protected Overrides Sub OnLeave ... Private _TrimText As Boolean ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Handle Worked - can someone please double check
    ... change the behavior of the trim ... ... Public Class myTextBox ... Protected Overrides Sub OnLeave ... Private _TrimText As Boolean ...
    (microsoft.public.dotnet.languages.vb)
  • How to code an implicit $_ argument?
    ... sub trim{ ... goto &trim; ... if (defined $$var) { ... later Perl interpreters notice and optimize the tail recursion. ...
    (comp.lang.perl.misc)
  • Re: Select until blank row
    ... Maybe I didn't need to trim it - I just wanted to stop selected at the first ... "Otto Moehrbach" wrote: ... Sub Maybe ... think is cluncky: ...
    (microsoft.public.excel.misc)