InitializeSpeak(hTtsInst, pInText, hEditBox, &stSpeak); /*-- Open audio channel. --*/ pcmWaveFormat.wf.wFormatTag = WAVE_FORMAT_PCM; pcmWaveFormat.wf.nChannels = 1; pcmWaveFormat.wf.nBlockAlign = 2; pcmWaveFormat.wf.nSamplesPerSec = freq; pcmWaveFormat.wf.nAvgBytesPerSec = pcmWaveFormat.wf.nSamplesPerSec * pcmWaveFormat.wf.nBlockAlign; pcmWaveFormat.wBitsPerSample = pcmWaveFormat.wf.nBlockAlign * 8; #ifdef USE_SEMAPHORES char a[20]; nMmRes = waveOutOpen (&(stSpeak.hWaveOut), WAVE_MAPPER, (LPWAVEFORMATEX) &pcmWaveFormat,(DWORD) SpeakCallBack, (DWORD)(stSpeak.hPcmSema4), CALLBACK_FUNCTION|WAVE_ALLOWSYNC); itoa(nMmRes,a,20); LOG(a);///TO log the return value of waveOutOpen #else nMmRes = waveOutOpen (&(stSpeak.hWaveOut), WAVE_MAPPER, (LPWAVEFORMATEX) &pcmWaveFormat,0, 0, CALLBACK_NULL); #endif if (MMSYSERR_NOERROR != nMmRes) { waveOutGetErrorText (nMmRes, szErr, sizeof (szErr) / sizeof (TCHAR)); // Notify(hwnd, szErr); return NUAN_E_NOK; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)