Wave Function CALLBACK HandleEvent

This is a discussion on Wave Function CALLBACK HandleEvent within the xharbour forums in Programming Languages category; Dear Harbour User I want to make a simple Voice Recoder by using WaveInOpen and WaveOutOpen Function. I set CALLBACK to WINDOW (the Function is as follows) and I tried to receive MM_WIN_OPEN, MM_WIN_DATA of HandleEvent. But I don't know what to set the Class Name of CreateWindow. I really need your help. Or Are there any Voice Recoder Sample File made by Harbour? define MM_WIM_OPEN 958 /* waveform input */ #define MM_WIM_CLOSE 959 #define MM_WIM_DATA 960 CLASS TWave FROM TControl DATA hWaveIn METHOD New() CONSTRUCTOR METHOD WaveInStart( oWnd ) ... METHOD HandleEvent( nMsg, nWParam, nLParam ) ... ENDCLASS METHOE ...

Go Back   Application Development Forum > Programming Languages > xharbour

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-13-2008, 10:11 PM
oknbs
Guest
 
Default Wave Function CALLBACK HandleEvent

Dear Harbour User

I want to make a simple Voice Recoder by using WaveInOpen and
WaveOutOpen Function.
I set CALLBACK to WINDOW (the Function is as follows) and I tried to
receive MM_WIN_OPEN, MM_WIN_DATA of HandleEvent.
But I don't know what to set the Class Name of CreateWindow.
I really need your help.
Or Are there any Voice Recoder Sample File made by Harbour?


define MM_WIM_OPEN 958 /* waveform input */
#define MM_WIM_CLOSE 959
#define MM_WIM_DATA 960


CLASS TWave FROM TControl

DATA hWaveIn

METHOD New() CONSTRUCTOR
METHOD WaveInStart( oWnd )
...
METHOD HandleEvent( nMsg, nWParam, nLParam )
...
ENDCLASS


METHOE New() CLASS TWave

::Create( "????" ) => ? Class Name
//

Return Self


METHOD WaveInStart( oWnd ) CLASS TWave

LOCAL hWaveIn

if WaveInOpen( &hWaveIn, oWnd:hWnd ) >= 0
::hWaveIn := hWaveIn
//
endif

Return NIL


METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TWave

do case
case nMsg == MM_WIN_OPEN
//
case nMsg == MM_WIN_DATA
//
otherwise
//
endcase

Return NIL



HB_FUNC( WAVEINOPEN )
{
HWAVEIN hWaveIn;
WAVEFORMATEX waveformat;
int nResult;

waveformat.wFormatTag =
WAVE_FORMAT_PCM;
waveformat.nChannels =
1 ;
waveformat.nSamplesPerSec =
11025;
waveformat.wBitsPerSample =
8;
waveformat.nBlockAlign =
waveformat.nChannels*waveformat.wBitsPerSample/8;
waveformat.nAvgBytesPerSec =
waveformat.nSamplesPerSec*waveformat.nBlockAlign;
waveformat.cbSize =
0;

nResult = WaveInOpen( &hWaveIn, WAVE_MAPPER,
(WAVEFORMATEX)&waveformat,
(DWORD) hb_parnl(2), 0,
CALLBACK_WINDOW );

hb_stornl( ( LONG ) hWaveIn, 1 );
hb_retni( nResult );
}

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:53 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.