Displaying 10 results from an estimated 10 matches for "lphdr".
Did you mean:
phdr
2004 Aug 06
1
C++ wrapper for speex
...d i supposed i could do it
also, but i'm really confused now with all my failed
attempts.)
i'm particularly interested with real-time audio and i
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);...
2004 Aug 06
0
C++ wrapper for speex
...m really confused now with all my failed
> attempts.)
>
> i'm particularly interested with real-time audio and i
> 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;
>...
2005 Jan 05
4
Encoding and decoding problem in speex 1.0.4
...= 0;
m_WaveFormatEx.nSamplesPerSec = 8000;
m_WaveFormatEx.nBlockAlign = 1;
m_WaveFormatEx.nAvgBytesPerSec = 8000;
The recording is as follows :-
When the buffer(size = 2000 bytes) gets filled with sound data a
function with the body shown
below is called.
LPWAVEHDR lpHdr = (LPWAVEHDR) lParam;
if(lpHdr->dwBytesRecorded==0 || lpHdr==NULL)
return ERROR_SUCCESS;
::waveInUnprepareHeader(m_hRecord, lpHdr, sizeof(WAVEHDR));
Here lpHdr->lpData contains the audio data in a character array.
Now here I want to use Speex codec for encoding the data so the e...
2004 Aug 06
1
C++ wrapper for speex
...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 after
each method call, and before you try to call any
methods (beyond the constructor). For exa...
2004 Aug 06
2
C++ wrapper for speex
...ember lpData, and this variable is of
LPSTR type.
if you have the time, can you please check on my test
code below and see where i could be having problems
with. (this is the handler that processes captured
audio)
LRESULT CRecordSound::OnSoundData(WPARAM wParam,
LPARAM lParam)
{
LPWAVEHDR lpHdr = (LPWAVEHDR) lParam;
int buflen = lpHdr->dwBufferLength; //160
float * buf = toFloat(lpHdr->lpData, buflen);
// Encode some audio
int nRet = enc.encode(buf, buflen);
unsigned char *compressed = enc.getOutput();
int clen = enc.getOutputLe...
2006 Nov 01
1
Integrating speex with VideoNet application: Constant background noise
...ec = 8000;
int quality =8;
speex_bits_init(&bits);
enc_state = speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &quality);
In my recording callback function
LRESULT RecordSound::OnSoundData(WPARAM wParam, LPARAM lParam)
{
....
dataPtr = (char *)lpHdr ->lpData;
dataSize = (int)lpHdr ->dwBytesRecorded;
for(int k=0;k<FRAME_SIZE;k++)
input[k] = dataPtr[k]; //input is float[FRAME_SIZE]
speex_bits_reset(&bits);
speex_encode(enc_state, input, &bits);
encByte = speex_bits_write(&bits, cbits, 20...
2006 Nov 02
1
Integrating speex with VideoNet application: Constantbackground noise
...quality
=8;
speex_bits_init(&bits);
enc_state =
speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(enc_state,
SPEEX_SET_QUALITY, &quality);
In my recording callback
function
LRESULT RecordSound::OnSoundData(WPARAM wParam, LPARAM
lParam)
{
....
dataPtr = (char *)lpHdr
->lpData;
dataSize = (int)lpHdr
->dwBytesRecorded;
for(int
k=0;k<FRAME_SIZE;k++)
input[k] =
dataPtr[k]; //input is
float[FRAME_SIZE]
speex_bits_reset(&bits);
speex_encode(enc_state,
input, &bits);
encByte = speex_bits_write(...
2006 Oct 30
0
Integrating speex with VideoNet application: Constant background noise
...ec = 8000;
int quality =8;
speex_bits_init(&bits);
enc_state = speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &quality);
In my recording callback function
LRESULT RecordSound::OnSoundData(WPARAM wParam, LPARAM lParam)
{
....
dataPtr = (char *)lpHdr ->lpData;
dataSize = (int)lpHdr ->dwBytesRecorded;
for(int k=0;k<FRAME_SIZE;k++)
input[k] = dataPtr[k]; //input is float[FRAME_SIZE]
speex_bits_reset(&bits);
speex_encode(enc_state, input, &bits);
encByte = speex_bits_write(&bits, cbits, 20...
2006 Nov 05
1
Integrating speex with VideoNet application: Constantbackground noise
...=8;
speex_bits_init(&bits);
enc_state =
speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(enc_state,
SPEEX_SET_QUALITY, &quality);
In my recording callback
function
LRESULT RecordSound::OnSoundData(WPARAM wParam, LPARAM
lParam)
{
....
dataPtr = (char *)lpHdr
->lpData;
dataSize = (int)lpHdr
->dwBytesRecorded;
for(int
k=0;k<FRAME_SIZE;k++)
input[k] =
dataPtr[k]; //input is
float[FRAME_SIZE]
speex_bits_reset(&bits);
speex_encode(enc_state,
input, &bits);
encByte =...
2006 Dec 24
1
Integrating speex with VideoNet application: Constantbackground noise
...=8;
speex_bits_init(&bits);
enc_state =
speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(enc_state,
SPEEX_SET_QUALITY, &quality);
In my recording callback
function
LRESULT RecordSound::OnSoundData(WPARAM wParam, LPARAM
lParam)
{
....
dataPtr = (char *)lpHdr
->lpData;
dataSize = (int)lpHdr
->dwBytesRecorded;
for(int
k=0;k<FRAME_SIZE;k++)
input[k] =
dataPtr[k]; //input is
float[FRAME_SIZE]
speex_bits_reset(&bits);
speex_encode(enc_state,
input, &bits);
encByte =...