+ Responder ao Tópico



  1. #1
    Barata_Branca_Do_Esgoto
    e ai galera.. blz? altas horas da noite... e nois acordado aki... olha soh, quando eu vou compilar ele diz q esse código aki está errado... me digam o que pode estar errado...
    F L W!!!

    Código :
    class WaveHeader : public WAVEHDR -->>DIZ QUE AQUI ESTA ERRADO
    {
    public:
    	-->>DIZ QUE AQUI ESTA ERRADO bool isDone() const { return dwFlags & WHDR_DONE ; } ;
    } ;
     
    class WaveFormat : public WAVEFORMATEX
    {
    public:
    	WaveFormat( DWORD rate, WORD chan, WORD bits )
    	{
    		wFormatTag = WAVE_FORMAT_PCM ;
    		-->>DIZ QUE AQUI ESTA ERRADO nChannels = chan ;
    		-->>DIZ QUE AQUI ESTA ERRADOnSamplesPerSec = rate ;
    		-->>DIZ QUE AQUI ESTA ERRADOnAvgBytesPerSec = chan * rate * bits / 8 ;
    		nBlockAlign = chan * bits / 8 ;
    		wBitsPerSample = bits ;
    		cbSize = 0 ;
    	} ;
    } ;
     
     
    class WaveIn
    {
    public:
     
    	WaveIn() : status( MMSYSERR_BADDEVICEID ) {} ;
    	~WaveIn() { if( ok() ) { Stop(); Reset() ; Close() ; } ; } ;
     
    	bool Open( HWND, UINT, WaveFormat& ) ;
    	bool Close() ;
    	void Reset() { if( ok() ) waveInReset( hWave ) ; } ;
     
    	void Start() { waveInStart( hWave ) ; } ;
    	void Stop() { waveInStop( hWave ) ; } ;
     
    	void Prepare( WaveHeader* ) ;
    	void UnPrepare( WaveHeader* ) ;
    	void Send( WaveHeader* ) ;
     
    	LPSTR queryError() ;
    	LPCSTR queryTitle() { return "WaveAudio Input Engine" ; } ;
    	bool ok() { return status == 0 ; } ;
    	bool isInUse() { return status == MMSYSERR_ALLOCATED ; } ;
     
    private:
     
    	HWAVEIN hWave ;
    	UINT status ;
    	char errorText[164] ;
    } ;
     
    class Recorder
    {
    	enum { NUM_BUF = 8 } ;
    public:
    	Recorder( WORD cSamples, DWORD cSamplesPerSec, WORD nChannels, WORD bits ) ;
    	~Recorder() ;
     
    	bool Start( HWND hwnd ) ;
    	void Stop() ;
     
    	bool isBufferDone() const { return _header[_iBuf].isDone() ; } ;
    	bool BufferDone() ;
     
    	bool FillVector( svector<double>& ) ;
     
    	WORD SampleCount() const { return _cSamples ; } ;
    	DWORD SamplesPerSec() const { return _cSamplesPerSec ; } ;
    	WORD Bits() const { return _bits ; } ;
    	WORD Channels() const { return _nChannels ; } ;
     
    protected:
     
    	WaveIn _wave ;
    	int _iBuf ;
     
    	WORD _cSamples ;
    	DWORD _cSamplesPerSec ;
    	WORD _nChannels ;
    	WORD _bits ;
    	WORD _cbBuf ;
     
    	WaveHeader _header [ NUM_BUF ] ;
    	LPSTR _dataPool ;
    	svector<int> avoid_errors ;
    } ;
     
    inline bool WaveIn::Open( HWND hWnd, UINT id, WaveFormat& fmt )
    {
    	status = waveInOpen( &hWave, id, &fmt, (DWORD)hWnd, NULL, CALLBACK_WINDOW ) ;
    	return ok() ;
    } ;
     
    inline bool WaveIn::Close()
    {
    	if( waveInClose( hWave ) == 0 && ok() )
    	{
    		status = MMSYSERR_BADDEVICEID ;
    		return true ;
    	} ;
    	return false ;
    } ;
     
    inline void WaveIn::Prepare( WaveHeader* phdr )
    {
    	waveInPrepareHeader( hWave, phdr, sizeof(WAVEHDR) ) ;
    } ;
     
    inline void WaveIn::UnPrepare( WaveHeader* phdr )
    {
    	waveInUnprepareHeader( hWave, phdr, sizeof(WAVEHDR) ) ;
    } ;
     
    inline void WaveIn::Send( WaveHeader* phdr )
    {
    	waveInAddBuffer( hWave, phdr, sizeof(WAVEHDR) ) ;
    } ;
     
    inline LPSTR WaveIn::queryError()
    {
    	waveInGetErrorText( status, errorText, sizeof(errorText) ) ;
    	return errorText ;
    } ;class WaveHeader : public WAVEHDR
    {
    public:
    	bool isDone() const { return dwFlags & WHDR_DONE ; } ;
    } ;
     
    class WaveFormat : public WAVEFORMATEX
    {
    public:
    	WaveFormat( DWORD rate, WORD chan, WORD bits )
    	{
    		wFormatTag = WAVE_FORMAT_PCM ;
    		nChannels = chan ;
    		nSamplesPerSec = rate ;
    		nAvgBytesPerSec = chan * rate * bits / 8 ;
    		nBlockAlign = chan * bits / 8 ;
    		wBitsPerSample = bits ;
    		cbSize = 0 ;
    	} ;
    } ;
     
     
    class WaveIn
    {
    public:
     
    	WaveIn() : status( MMSYSERR_BADDEVICEID ) {} ;
    	~WaveIn() { if( ok() ) { Stop(); Reset() ; Close() ; } ; } ;
     
    	bool Open( HWND, UINT, WaveFormat& ) ;
    	bool Close() ;
    	void Reset() { if( ok() ) waveInReset( hWave ) ; } ;
     
    	void Start() { waveInStart( hWave ) ; } ;
    	void Stop() { waveInStop( hWave ) ; } ;
     
    	void Prepare( WaveHeader* ) ;
    	void UnPrepare( WaveHeader* ) ;
    	void Send( WaveHeader* ) ;
     
    	LPSTR queryError() ;
    	LPCSTR queryTitle() { return "WaveAudio Input Engine" ; } ;
    	bool ok() { return status == 0 ; } ;
    	bool isInUse() { return status == MMSYSERR_ALLOCATED ; } ;
     
    private:
     
    	HWAVEIN hWave ;
    	UINT status ;
    	char errorText[164] ;
    } ;
     
    class Recorder
    {
    	enum { NUM_BUF = 8 } ;
    public:
    	Recorder( WORD cSamples, DWORD cSamplesPerSec, WORD nChannels, WORD bits ) ;
    	~Recorder() ;
     
    	bool Start( HWND hwnd ) ;
    	void Stop() ;
     
    	bool isBufferDone() const { return _header[_iBuf].isDone() ; } ;
    	bool BufferDone() ;
     
    	bool FillVector( svector<double>& ) ;
     
    	WORD SampleCount() const { return _cSamples ; } ;
    	DWORD SamplesPerSec() const { return _cSamplesPerSec ; } ;
    	WORD Bits() const { return _bits ; } ;
    	WORD Channels() const { return _nChannels ; } ;
     
    protected:
     
    	WaveIn _wave ;
    	int _iBuf ;
     
    	WORD _cSamples ;
    	DWORD _cSamplesPerSec ;
    	WORD _nChannels ;
    	WORD _bits ;
    	WORD _cbBuf ;
     
    	WaveHeader _header [ NUM_BUF ] ;
    	LPSTR _dataPool ;
    	svector<int> avoid_errors ;
    } ;
     
    inline bool WaveIn::Open( HWND hWnd, UINT id, WaveFormat& fmt )
    {
    	-->>DIZ QUE AQUI ESTA ERRADO status = waveInOpen( &hWave, id, &fmt, (DWORD)hWnd, NULL, CALLBACK_WINDOW ) ;
    	return ok() ;
    } ;
     
    inline bool WaveIn::Close()
    {
    	if( waveInClose( hWave ) == 0 && ok() )
    	{
    		status = MMSYSERR_BADDEVICEID ;
    		return true ;
    	} ;
    	return false ;
    } ;
     
    inline void WaveIn::Prepare( WaveHeader* phdr )
    {
    	waveInPrepareHeader( hWave, phdr, sizeof(WAVEHDR) ) ;
    } ;
     
    inline void WaveIn::UnPrepare( WaveHeader* phdr )
    {
    	waveInUnprepareHeader( hWave, phdr, sizeof(WAVEHDR) ) ;
    } ;
     
    inline void WaveIn::Send( WaveHeader* phdr )
    {
    	waveInAddBuffer( hWave, phdr, sizeof(WAVEHDR) ) ;
    } ;
     
    inline LPSTR WaveIn::queryError()
    {
    	waveInGetErrorText( status, errorText, sizeof(errorText) ) ;
    	return errorText ;
    } ;


    FLWWWWWWWWWWWWWWWWWWW!

  2. #2
    Barata_Branca_Do_Esgoto
    bem, acordei agora poko, só to comentando msm pra ver se alguem responde... ...
    FLWWWWWWWWWWWWWWWWWW!!!









Tópicos Similares

  1. o que esta errado ? [script logon no velox]
    Por mceiras no fórum Linguagens de Programação
    Respostas: 1
    Último Post: 13-01-2006, 07:00
  2. O que esta errado no meu smb.conf???
    Por no fórum Servidores de Rede
    Respostas: 11
    Último Post: 22-06-2005, 08:01
  3. O que está errado?
    Por sarna no fórum Servidores de Rede
    Respostas: 9
    Último Post: 04-03-2005, 08:20
  4. O que esta errado?!?!?! Socorro!!
    Por no fórum Redes
    Respostas: 1
    Último Post: 15-07-2004, 07:14
  5. onde esta errado nesse comando CUT?!
    Por mcclaudio no fórum Servidores de Rede
    Respostas: 3
    Último Post: 06-10-2003, 22:30

Visite: BR-Linux ·  VivaOLinux ·  Dicas-L