I have this VB code chunk that creates 2 instances of a COM object, the
purpose of which is to encode a .wav file into a .asf file.  Does anyone
know how to translate this into ColdFusion?  I've been messing with it on
and off for 2 months, but I haven't gotten it to work yet.

'Create multiple instances of the encoder object
  Dim Encoder1 As Object
  Dim Encoder2 As Object
  Set Encoder1 = CreateObject("ASF.RealTimeEncoder")
  Set Encoder2 = CreateObject("ASF.RealTimeEncoder")

'Load previously created Windows Media stream descriptor file for Encoder1.
  Encoder1.LoadASD("C:\SampleConfig1.asd")

'Load a different descriptor file for Encoder2.
  Encoder2.LoadASD("C:\SampleConfig2.asd")

'Reset the input file name of the source to be encoded for Encoder1
  Encoder1.InputSourceFile = "C:\sample.wav"

'Start encoding
  Encoder1.Start
  Encoder2.Start

'Check if Encoder1 has started encoding
  If Encoder1.IsStarted Then
   MsgBox("Encoder1 is encoding")
  Else
   MsgBox("Encoder1 is not encoding.")
  End If

'Start Encoder1 recording the content previously set in the descriptor
'stream file assigned to it
  Encoder1.RecordStart

'Change the output file name for Encoder2 after the encoder starts
'recording
  Encoder2.RecordStop
  Encoder2.RecordMaxSize = 5000
  Encoder2.RecordFileName = "C:\MyNewOutputFileName.asf"
  Encoder2.RecordStart

'Stop Encoder1 and Encoder2 recording to files
  Encoder1.RecordStop
  Encoder2.RecordStop

'Stop all encoding
  Encoder1.Stop
  Encoder2.Stop

'Release the encoder objects from memory
  Set Encoder1 = Nothing
  Set Encoder2 = Nothing


Todd Ashworth



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to