Click here to Skip to main content
15,879,239 members
Articles / Desktop Programming / MFC

Voice conference using Multicasting Technique

Rate me:
Please Sign up or sign in to vote.
4.29/5 (11 votes)
31 Jul 20034 min read 117.3K   5.9K   71  
Using multicasting to create a voice conference
/// PlaySound1.h: interface for the PlaySound1 class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PlaySound1_H__EA26EF42_4169_11D6_8886_F00753C10001__INCLUDED_)
#define AFX_PlaySound1_H__EA26EF42_4169_11D6_8886_F00753C10001__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#define WM_PLAYSOUND_STARTPLAYING WM_USER+600
#define WM_PLAYSOUND_STOPPLAYING WM_USER+601
#define WM_PLAYSOUND_PLAYBLOCK WM_USER+602
#define WM_PLAYSOUND_ENDTHREAD  WM_USER+603

#define SOUNDSAMPLES 1000
#define PLAYBUFFER   2000
#define SAMPLEPSEC   8000


#include<afxmt.h>
#include<mmsystem.h>


class PlaySound1 : public CWinThread  
{
DECLARE_DYNCREATE(PlaySound1)

public:
	/*
	struct wave
	{
	WAVEFORMATEX wfx;
	WORD wSamplesPerBlock;
	}m_WaveFormatEx;
	*/
		
	WAVEFORMATEX m_WaveFormatEx;
	BOOL Playing;
	HWAVEOUT m_hPlay;
	CStdioFile log;
	CDialog *dlg;


	PlaySound1();
	PlaySound1(CDialog *dlg);
	virtual ~PlaySound1();
	BOOL InitInstance();
	int ExitInstance();
	void displayError(int code,char []);
	void displayHeader(LPWAVEHDR lphdr);
	LPWAVEHDR CreateWaveHeader(CString mesg);
	void ProcessSoundData(short int *sound, DWORD dwSamples);
	
	afx_msg LRESULT OnStartPlaying(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnStopPlaying(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnEndPlaySound1Data(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnWriteSoundData(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnEndThread(WPARAM wParam, LPARAM lParam);
	
	DECLARE_MESSAGE_MAP()

};

#endif // !defined(AFX_PlaySound1_H__EA26EF42_4169_11D6_8886_F00753C10001__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
India India
Nagareshwar is a security enthusiastic person involved in reverse engineering, vulnerability research, coding security tools etc. He spend most of the time in uncovering the secrets of computer world.

He holds 'Bachelor of Engineering' degree from National Institute of Technology of Karnataka, India. He had professional experience of 2.5 years in Novell. At Novell he was working on various security products including 'Novell Secure Login' and CASA.

For more details visit his website http://securityxploded.com

Comments and Discussions