Hi Ulrich,
I've never had any OutOfMEmoryExceptions in my tests, and I think
I've been rather thourough, although probably much more thourought
testing narrowband than wideband. Having said this, it is very hard to
get memory leaks in java, so I am sceptical about that. That memory
might not be used optimally is more likely the case. More often then not
reducing memory use increases processor use. Although is you feel like
doing some profiling of the code and find where the problem is, I wouild
be glad to improve things.
As far as processor is concerned. Speex is not the hungriest of
codecs out ther, but it is a CELP codec and therefore more advanced and
processor intensive then older codecs such as GSM or ADPCM. It's doing
quite a bit of signal processing. The code in Java is running in a
virtual machine so it's not going to perform as well as native C. I
haven't done too many test on dual processor machines, but on singal
processor machines 350 MHz really pretty close to the minimum
requirement for real time encoding. You had better not have anything
else running on your computer at the same time though. There are several
things that reduce the resources required. Narrowband uses less than
wideband or UWB. Lower quality uses less resources than higher quality.
Finally there is also an encoder setting called complexity.Reducing that
also reduces the required resources. Also the Use of VBR could slightly
increase the processor usage, and stereo too (if both stereo channels
are identical, best to reduce it to mono and encode mono rather than
encode stereo). But the best thing to do is play around with the various
settings and see which settings suit you best with the given resources
on your hardware.
Good luck
Marc Gimpel
Head of research
Wimba
Ulrich B. Staudinger wrote:
> hello,
>
> i switched to use the encoder.processData() and
> encoder.getProcessedData() of jspeex. however it looks to me like a
> memory leak ... memory usage is increasing very fast and there is no
> visible stop ... after about five minutes java.lang.OutOfMemory
> occurs. I think it must be the jspeex component, because before i
> added jspeex to my app usage was constant at about 5mb.
>
> is it possible to be jspeex ?
>
> another issue is speed - when doing UWB, quality 3, 44100 stereo
> encoding my cpu load goes up to 100% on a dual 350MHz - is it correct
> that lower quality uses significantly less cpu resources?
>
> thanks in advance,
> ulrich
>
> p.s. the quality for that bandwidth is really awesome ! Must be cool
> wavelets and other stuff or something alike ... ! Wow!
>
> --- >8 ----
> List archives: http://www.xiph.org/archives/
> Ogg project homepage: http://www.xiph.org/ogg/
> To unsubscribe from this list, send a message to
> 'speex-dev-request@xiph.org'
> containing only the word 'unsubscribe' in the body. No subject is
> needed.
> Unsubscribe messages sent to the list will be ignored/filtered.
>
>
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to
'speex-dev-request@xiph.org'
containing only the word 'unsubscribe' in the body. No subject is
needed.
Unsubscribe messages sent to the list will be ignored/filtered.
hello, i switched to use the encoder.processData() and encoder.getProcessedData() of jspeex. however it looks to me like a memory leak ... memory usage is increasing very fast and there is no visible stop ... after about five minutes java.lang.OutOfMemory occurs. I think it must be the jspeex component, because before i added jspeex to my app usage was constant at about 5mb. is it possible to be jspeex ? another issue is speed - when doing UWB, quality 3, 44100 stereo encoding my cpu load goes up to 100% on a dual 350MHz - is it correct that lower quality uses significantly less cpu resources? thanks in advance, ulrich p.s. the quality for that bandwidth is really awesome ! Must be cool wavelets and other stuff or something alike ... ! Wow! --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Hi,
I have to write a small programm which should be able to record speeches
and in addition synchronize the recorded speeches with measuring data.
My idea is to record the speech in the normal way with speex and without
ogg. If a sync message was received, i write a custom in-band messages
using mode 13 into the stream. Furthermore, i fill a structure with the
sync data and write the structure into an array. To determine the position
of the sync structure in the array, i have to write the array index of the
sync structure into the stream. Inside the user callback i have to read
the array index of the reached sync point from the stream and send it
within a notification message to the application.
The Problem is, after the decoder reached the custom in-band messages and
executed the user callback, the stream is corrupted and speex_decode()
returns -2.
I don't know where the problem is.
I can't find any sample code for custom in-band messages.
Is there anyone who can help?
Here some sample code:
/********************************** encoder
*********************************************/
// read raw data from serving buffer
void CSpeexEncoderThread::Decode(char * pcData, DWORD dwLength){
...
speex_encode(st, s, &bits); // encode
...
if (syncmsg == TRUE && synccount < 256){ // is there a sync
message?
syncstruct[synccount].sync_value = syncvalue; //fill the sync
structure
...
speex_bits_pack(&bits, 13, 5); //custom in-band messages
// write the array index of the sync structure into the stream
(max. 256
sync points)
speex_bits_pack(&bits, synccount, 8);
synccount++
}
<p> nbBytes = speex_bits_write(&bits, cbits, MAX_FRAME_BYTES);
...
// write the encoded data into the end buffer
...
speex_bits_reset(&bits);
...
}
/********************************** encoder end
********************************************/
/************************************* decoder
*********************************************/
int CSpeexDecoderThread::SpeexUserCallback(SpeexBits *bits, void *state,
void *data){
...
// read the array index of the corresponding sync structure
int index = speex_bits_unpack_unsigned(bits, 8);
SendNotifyMessage(l_sdthread->m_hWnd, USER_PLAYBACK_MESSAGE,
SYNC_DATA,
LPARAM(index));
return 0;
}
inline int speex_bits_init_buffer_ex(SpeexBits *bits, void *buff, int
buf_size){
if (buff == NULL || buf_size == 0)
return -1;
memset(bits, 0, sizeof(SpeexBits));
bits->bytes = (char*)buff;
bits->buf_size = buf_size;
bits->nbBits=buf_size << 3;
return 0;
}
int CSpeexDecoderThread::DecodePlay(void* state, SpeexStereoState stereo,
char* pcData, DWORD dwLength, int nchannels, int frame_size, int
synccount){
...
if (synccount > 0){
callback.callback_id = 0;
callback.func = SpeexUserCallback;
callback.data = this;
speex_decoder_ctl(state, SPEEX_SET_USER_HANDLER, &callback);
}
...
speex_bits_init_buffer_ex(&bits, pcData, dwLength);
while (1 == 1){
...
retval = speex_decode(state, &bits, output);
if (retval == -1){
return -1; //return DECODE_ENDOFSTREAM;
} else if (retval == -2){
return -2;
}
...
// play the sample
}
}
The second question, is there something wrong with the speex_uwb_mode
since version 1.1?
It don't work. Only speex_nb_mode and speex_wb_mode works.
Norman
ps: sorry for my pure english.
<p><p><p><p><p><p><p><p><p><p>---
>8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to
'speex-dev-request@xiph.org'
containing only the word 'unsubscribe' in the body. No subject is
needed.
Unsubscribe messages sent to the list will be ignored/filtered.