search for: psound

Displaying 4 results from an estimated 4 matches for "psound".

Did you mean: sound
2004 Aug 06
2
C++ wrapper for speex
...nc.getOutputLength(); int speechDetected = enc.getSpeechDetected(); // delete temporary float buffer delete []buf; // Decode it int decodedSamples = dec.decode(compressed, clen); // Prepare decoded data for WAV BYTE pSound = new BYTE[decodedSamples * sizeof(short)]; memcpy(pSound, (BYTE*)dec.getOutput(), decodedSamples * sizeof(short)); // Create and initialise the WAVEHDR structure WAVEHDR* pSpeexHdr = new WAVEHDR; pSpeexHdr->lpData = (char*)pSound; pSpeexHdr-&...
2004 Aug 06
1
C++ wrapper for speex
Ronald, I suggest we take this discussion off the list after this post. I don't see any problems with your code. However, I can make a few suggestions: 1) If you replace the lines: pSpeexHdr->lpData = (char*)pSound; pSpeexHdr->dwBufferLength = decodedSamples * sizeof(short); with: pSpeexHdr->lpData = lpHdr->lpData; pSpeexHdr->dwBufferLength = lpHdr->dwBufferLength; does it sound right? If not, your problem is not with the encoding or decoding. 2) Try checking the error state of the classes...
2004 Aug 06
1
C++ wrapper for speex
...that captures audio samples like the ff: void CRecordSound::OnSoundData(WPARAM wParam, LPARAM lParam) { LPWAVEHDR lpHdr = (LPWAVEHDR) lParam; if(lpHdr) { WAVEHDR* pSpeexHdr = new WAVEHDR; BYTE * pSound = new BYTE[lpHdr->dwBufferLength]; memcpy(pSound,lpHdr->lpData,lpHdr->dwBufferLength); pSpeexHdr->lpData = (char*)pSound; pSpeexHdr->dwBufferLength = lpHdr->dwBufferLength;...
2004 Aug 06
0
C++ wrapper for speex
...t; have an event handler that captures audio samples like > the ff: > > void CRecordSound::OnSoundData(WPARAM wParam, LPARAM > lParam) > { > LPWAVEHDR lpHdr = (LPWAVEHDR) lParam; > > if(lpHdr) > { > WAVEHDR* pSpeexHdr = new WAVEHDR; > > BYTE * pSound = new BYTE[lpHdr->dwBufferLength]; > memcpy(pSound,lpHdr->lpData,lpHdr->dwBufferLength); > > pSpeexHdr->lpData = (char*)pSound; > pSpeexHdr->dwBufferLength = lpHdr->dwBufferLength; > pSpeexHdr->dwFlags = 0L; > pSpeexHdr->dwLoops = 0L;...