Dear all,
I need to change the LM (and dic file)
dynamically. I mean at run-time. I am using
the Win32 Sphinx OCX.
Unfortunately the init method is slow (8
seconds), so what I would like is to init
the shinx only once at the beginning, then each time I want to change the LM
and dic file, use the following methods
StopListening( );
DeleteLM(current LM);
SetLM(new LM);
for each new word in dictionnary
{
AddNewWord(new LM name, ??, newWord, new word pron);
}
StartListening( );
Am I correct, or did anybody use another
method successfully?
Thank you in advance !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm sure that there is a good reason why the keepers of this forum do not answer simple questions like this. I'll step in here.
I have been trying to use this on linux, FYI. However, if you look in the sphinx doc file (sphinx2.htm), you'll see that there is a call to switch LM's. Sphinx is an engine and the "frontend" that CMU put on it seems to be more for demo purposes than real use. Call uttproc_set_lm sets the current LM in use. These are originally fed via the -lmcntfn pointer which points to a file that has each pointer to the individual LM and its name -- so that it can be called..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanx Nancy.
But I also need to change to dic file (all
the possible words and their pronunciations)...
So what I tried is to patch the KB() function
wich is called by the init.
My patch makes it load invariants (cep, dcep...)
only once.
Everything works well (the first init lasts 11
seconds, the next ones last 1 second).
But still I have enormous memory leaks. After
16 context switches, my 128 meg PC stops, out
of memory...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Nancy, my previous message is not perfectly
clear I'm afraid.
I tried your method, with lm_read() and
uttproc_set_lm(), and it seems to change
correctly the LM.
But as I explained, I also need to change the
dic file. So I tried to use dict_new() and
dict_read() before changing LM with your method,
and then it worked, but with much memory wasted
because the previous dic data is kept in
memory, even if not used (it is not released
with free() )
Do you know a way to change the active dic file
properly or to release the memory used by the
previous dic file?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear all,
I need to change the LM (and dic file)
dynamically. I mean at run-time. I am using
the Win32 Sphinx OCX.
Unfortunately the init method is slow (8
seconds), so what I would like is to init
the shinx only once at the beginning, then each time I want to change the LM
and dic file, use the following methods
StopListening( );
DeleteLM(current LM);
SetLM(new LM);
for each new word in dictionnary
{
AddNewWord(new LM name, ??, newWord, new word pron);
}
StartListening( );
Am I correct, or did anybody use another
method successfully?
Thank you in advance !
I'm sure that there is a good reason why the keepers of this forum do not answer simple questions like this. I'll step in here.
I have been trying to use this on linux, FYI. However, if you look in the sphinx doc file (sphinx2.htm), you'll see that there is a call to switch LM's. Sphinx is an engine and the "frontend" that CMU put on it seems to be more for demo purposes than real use. Call uttproc_set_lm sets the current LM in use. These are originally fed via the -lmcntfn pointer which points to a file that has each pointer to the individual LM and its name -- so that it can be called..
Thanx Nancy.
But I also need to change to dic file (all
the possible words and their pronunciations)...
So what I tried is to patch the KB() function
wich is called by the init.
My patch makes it load invariants (cep, dcep...)
only once.
Everything works well (the first init lasts 11
seconds, the next ones last 1 second).
But still I have enormous memory leaks. After
16 context switches, my 128 meg PC stops, out
of memory...
Nancy, my previous message is not perfectly
clear I'm afraid.
I tried your method, with lm_read() and
uttproc_set_lm(), and it seems to change
correctly the LM.
But as I explained, I also need to change the
dic file. So I tried to use dict_new() and
dict_read() before changing LM with your method,
and then it worked, but with much memory wasted
because the previous dic data is kept in
memory, even if not used (it is not released
with free() )
Do you know a way to change the active dic file
properly or to release the memory used by the
previous dic file?
Thanks
I added dict_free(dictT *dict) to dict.c and dict.h which will free a dictionary. This is in CVS only right now, though.
kevin
Thank you very much kevin
Anselme