Ejemplo n.º 1
0
static LONG APIENTRY MixHandler(ULONG ulStatus, PMCI_MIX_BUFFER  pBuffer,
                                      ULONG ulFlags)
#ifdef __WATCOMC__
 #pragma on (unreferenced)
#endif
{
ULONG Wrote;
char tmptxt[12];

      //Transfer buffer to DART
      if(pBuffer->pBuffer) {
     Wrote = wavfile.writeData((char*)pBuffer->pBuffer, pBuffer->ulBufferLength);
//     DosWrite(modin, pBuffer->pBuffer, pBuffer->ulBufferLength, &Wrote);

	  BytesRecorded += Wrote;
	  sprintf(tmptxt, "%9d ", BytesRecorded); 
	  VioWrtCharStr(&tmptxt[0], (USHORT)strlen(tmptxt), CurPosX, CurPosY, 0);
      }

      MixSetupParms.pmixRead( MixSetupParms.ulMixHandle,
                              &MixBuffers[BufNr],
                              1);
      if(BufNr == NUM_BUFFERS-1) BufNr = 0;
      else           	         BufNr++;
      return(TRUE);
}
Ejemplo n.º 2
0
//******************************************************************************
//******************************************************************************
int StartRecording()
{
  cout << "Record mode: " << RecSettings.rate << " hz "<< RecSettings.bits << " bits";
  if(RecSettings.numchan == 1) cout << " mono" << endl;
  else 			       cout << " stereo" << endl;
  cout << "Data Format: ";
  switch(RecSettings.format) {
  	case MCI_WAVE_FORMAT_IBM_MULAW:
		cout << "uLaw" << endl;
		break;
	case MCI_WAVE_FORMAT_IBM_ALAW:
		cout << "aLaw" << endl;
		break;
	case MCI_WAVE_FORMAT_AVC_ADPCM:
		cout << "IMA ADPCM" << endl;
		break;
	case MCI_WAVE_FORMAT_PCM:
		cout << "PCM" << endl;
		break;
  }
//  cout << "Recorded bytes: ";
  cout << "Recorded bytes: "<<endl;
  VioGetCurPos(&CurPosX, &CurPosY, 0);

  CurPosX--;
  CurPosY = 16;

  MixSetupParms.pmixRead( MixSetupParms.ulMixHandle,
                          &MixBuffers[0],
                          ulNumBuffers);
  return(TRUE);
}