Hi Mike,
When I press the record button the message "Recording" appear I wait 30 seconds and press Stop. The message Stopping Recording appear. I look in my temp directory and the recording did not save. No error message etc.
I placed these codes inside a container class. Yet I did test it in a prg with the same results.
*
*
* Init Method
*
Method: INIT
DECLARE integer mciSendString IN WinMM.DLL ;
STRING cCommand, STRING @cRetStr, INTEGER nRetLen, ;
INTEGER wHnd
retstr=space(100)
retlen=100
RETURN
*
*
*
*
Start Button Code:
WAIT WINDOW NOWAIT "Recording ..."
THIS.PARENT.RecordNew('C:\Temp\MyNewFile.wav')
*
*
* Method for RecordNew
*
*
Method RecordNew
LPARAMETER pcFName
MESSAGEBOX(pcFName)
IF NOT EMPTY(THIS.DEVICE)
THIS.SendString('close '+THIS.DEVICE)
ENDIF
THIS.DEVICE = 'mywaveaudio'
THIS.SendString('open new type waveaudio alias '+THIS.DEVICE+' buffer 6')
THIS.SendString('record '+THIS.DEVICE)
RETURN .T.
Stop/Save Button Code:
Method Click()
WAIT WINDOW NOWAIT "Stopped recording ..."
THIS.Parent.Stop()
THIS.Parent.SAVE('C:\Temp\MyNewFile.wav')
*
*
* Stop Method
*
Method Click()
THIS.SendString( "stop "+THIS.DEVICE )
RETURN .T.
*
*
* Save Method
METHOD: SAVE
LPARAMETER pcFileName
THIS.ALIAS = "MyNewFile.wav"
IF VARTYPE(pcFileName)='C'
THIS.SendString( 'save '+THIS.ALIAS+' '+pcFileName )
ELSE
IF LOWER(THIS.element)<>'new'
THIS.SendString( 'save '+THIS.ALIAS )
ENDIF
ENDIF
RETURN .T.
*
* SendString Method
*
METHOD: SendString
LPARAMETERS cString
LOCAL cRet, err
cRet = SPACE(60)
err = mciSendString(cString,@cRet,60,0)
RETURN cRet