How to read file and play it:

//MySound *pMySound=new MySound();
		  //Reading in one step and playing
		  //pMySound->InitDS(pParams->hwnd);				//Initializing DirectSound
		  //pMySound->OpenMMFileRead(pParams->hwnd, "mono.wav");	//Opening MM file for Read
		 // pMySound->ReadWholeFile(pParams->hwnd) ;			//Reads the whole file at once
		  //pMySound->CreateBasicBuffer(pParams->hwnd);		//Creates the Basic Buffer
		  //pMySound->PlayFile(pParams->hwnd);					//Trying to play file
	      
		  
		  //Buffered reading and Playing
		  //pMySound->OpenMMFileRead(pParams->hwnd, "mono.wav");
		  //pMySound->InitDS(pParams->hwnd);
	      //pMySound->CreateBasicBuffer(pParams->hwnd);		//uses the same function but the buffer must be smaller
		  //pMySound->PlayFileBuffered(pParams->hwnd);
		  //
		 
		 
		 
		 
		 
		 
		 
		 
		 
		 
		 /*BOOL MySound :: StartTheCaptureBuffer(HWND hwnd){
	//'i' takes care for the size of the files. IF they get bigger 
	//then 1323000KBytes(60*22050) we create another file 
	int			i=1;
	TCHAR		szBuffer[60];
	SYSTEMTIME	tS; //structure for the time;
	
	//Reads the local time and creates file with the specific name.....
	GetLocalTime(&tS);
	wsprintf(szBuffer, "%u-%.2u-%.2u %.2u%.2u.wav", tS.wYear,tS.wMonth,tS.wDay,tS.wHour,tS.wMinute);
	this->OpenMMFileWrite(hwnd, szBuffer);
	
	
	if(DS_OK!=lpDSCB->Start(DSCBSTART_LOOPING)){// Starting the Loop
		MessageBox(hwnd, "Error when trying to start the Capture Buffer", "Error", MB_OK | MB_ICONEXCLAMATION);
		return 0;	
	}//

	while(1){
		WaitForSingleObject(rghEvent[0], 1000);//w8 for the first event
		ResetEvent(rghEvent[0]);
		if(!ReadFromSoundCard(hwnd,0)){
			MessageBox(hwnd, "Error with the ReadFromSoundCard function", "Error", MB_OK | MB_ICONEXCLAMATION);
			lpDSCB->Stop();
			break;	
		}
		WaitForSingleObject(rghEvent[1], 1000);//w8 for the second event
		ResetEvent(rghEvent[1]);
		if(!ReadFromSoundCard(hwnd,11025)){
			MessageBox(hwnd, "Error with the ReadFromSoundCard function", "Error", MB_OK | MB_ICONEXCLAMATION);
			lpDSCB->Stop();
			break;	
		}
		i++;
		if(i>60){//if the file reaches the size of 60secs create another file
			i=1;//reset i;
			if(mmioClose(hMMFileW,NULL)!=0){//close the old file
				MessageBox(hwnd, "Error closing file", "Error", MB_OK | MB_ICONEXCLAMATION);
				lpDSCB->Stop();
				break;
			}
			GetLocalTime(&tS);				//open new file with the new name		
			wsprintf(szBuffer,"%u-%.2u-%.2u %.2u%.2u.wav", tS.wYear,tS.wMonth,tS.wDay,tS.wHour,tS.wMinute);
			this->OpenMMFileWrite(hwnd, szBuffer);
		}

	}//while
	
	//lpDSCB->Release();
	return 1;
}*/
