PocketSphinx 5.0.0 release candidate 5

Executive Summary: Please try this one, there won’t be another.

Yes, it’s that time of week again, time for another release candidate You can also download it from PyPI.

There are a lot of changes so I suggest you look at the release notes at the link above. Python code should continue to work as before, though you may get some deprecated warnings when you try to use the inappropriately named set_{fsg,lm,kws} methods. Don’t use them, they have the wrong names, use add_* instead. The names were changed because they don’t set anything and you have to actually activate the search module afterwards. Now you use ps_activate_search() to do that, and not ps_set_search(), because this, too, is a much better name.

That’s actually the least of it. The big news is that force-alignment and subword alignment are now quite doable, from the command-line, from the C API, and from Python. There are some tests and examples for you to look at.

The last known portability issue (which was actually, like, a bug) is fixed and you won’t get unpredictable and bad results on MIPS systems. There are surely others, though. Ideally our CI testing would run things on various emulators, but it’s slow and unwieldy to do that.

The JSGF compiler is back to producing unreasonable numbers of epsilon transitions (“null” transitions for the less FST-aware), but it produces correct output now.

Pull requests and bug reports and such are welcome via https://github.com/cmusphinx/pocketsphinx.

PocketSphinx 5.0.0 release candidate 4

Executive Summary: Alas, poor SphinxBase!

Yes, it’s that time of week again, time for another release candidate. You can also download it from PyPI.

In the spirit of total elimination, the major change here is the disappearance of the <sphinxbase/*.h> headers. Some of them have been relocated, so if you include <pocketsphinx.h> you can still do useful things like load and save language models and parse JSGF. Oh, and also do speech recognition, maybe.

There are a number of other things you can’t do, because the “utility” headers were mostly unsuitable for public consumption. Really they were a bit embarrassing, at least in 2022. A major rationale for removing SphinxBase from circulation is that it just isn’t a good foundation for you to build “applications” or anything else really. Like, there are at least a dozen better implementations of pretty much everything in there, and you should really use them. Command-line parsing, for instance, should not be done with <cmd_ln.h>, so it has been hidden from you to discourage you from trying that.

Which brings us to the other major breaking change here. Configuration is not done by parsing (possibly imaginary) command lines anymore. You can simply create a configuration and set values in it, e.g.:

ps_config_t *config = ps_config_init(NULL);
ps_config_set_str(config, "hmm", "/path/to/model");
ps_config_set_int(config, "samprate", 11025);

You can also parse JSON, or even a sort of degenerate “JSON”:

ps_config_t *config = ps_config_parse_json(
    NULL, "{\"hmm\": \"/path/to/model\"}");
ps_config_t *config = ps_config_parse_json(
    NULL, "hmm: /path/to/model, samprate: 11025");

The configuration can be serialized to (actual) JSON as well:

const char *jconf = ps_config_serialize_json(config);

Creating a ps_config_t sets all of the default values, but does not set the default model, so you still need to use ps_default_search_args() for that. Also note that ps_expand_model_config() no longer creates magical underscore versions of the config parameters (e.g. "_hmm", "_dict", etc) but simply overwrites the existing values.

Python code is entirely unaffected by these changes (though it has also acquired the JSON functions mentioned above), so you should maybe use Python instead of hurting yourself with the C API.

Pull requests and bug reports and such are welcome via https://github.com/cmusphinx/pocketsphinx.

PocketSphinx 5.0.0 release candidate 3

Executive Summary: Try the new Python module (please).

Hot on the heels of the last one, there is another release candidate. You can also download it from PyPI.

There isn’t much to announce except that the pocketsphinx5 Python package doesn’t exist anymore. That’s right, the Python interface is now called just plain pocketsphinx. It should install properly on Windows and Mac OS X now, as well.

Pull requests and bug reports and such are welcome via https://github.com/cmusphinx/pocketsphinx.

PocketSphinx 5.0.0 release candidate 2

Executive Summary: This is a release candidate and the API is not yet stable so please don’t package it.

PocketSphinx now has a release candidate. You can also download it from PyPI.

Why release candidate 2? Because there was a release candidate 1, but it had various problems regarding installation, so I made another one. This one is relatively complete, but the documentation isn’t good, and it hasn’t been fully tested on Windows or Mac OS X. If you are courageous, you can try that. Installation should be a matter of:

cmake -S . -B build
cmake --build build
sudo cmake --build build --target install

The most important change versus 5prealpha is, as mentioned previously, the disappearance of pocketsphinx_continuous and the “live” API in general, which has been replaced with <pocketsphinx/endpointer.h>. The API is quite simple but it requires you to feed it data in precise quantities. The best way to do this is to ensure that you can read data from a file stream, as shown in the examples live.c and live.py.

For command-line usage there is a very Unixy program called pocketsphinx now, which nonetheless doesn’t have a man page yet (Update: it has a man page). Use it like this:

# From microphone
sox -d $(pocketsphinx soxflags) | pocketsphinx
# From file
sox audio.wav $(pocketsphinx soxflags) | pocketsphinx

There are no innovations with respect to modeling, algorithms, etc, and there will never be. But I am trying to make this into a decent piece of software nonetheless. All documentation, bug reports (that are actually bug reports and not just ‘how do i run the program’) and such are welcome via https://github.com/cmusphinx/pocketsphinx.