Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch back to Cython and use scikit-build for Python module #271

Merged
merged 22 commits into from
Jul 22, 2022

Conversation

dhdaines
Copy link
Contributor

@dhdaines dhdaines commented Jul 22, 2022

Cython makes somewhat larger binaries, but it has the following advantages:

  • Easier to create a "Pythonic" interface
  • Compatible with PyPy, or so I'm told
  • Much more obvious syntax and better documentation (no cryptic typemaps)
  • Installable from PyPI and well integrated with Python build tools (very, very important)

The SWIG code is unmaintained since a long time, I don't have time to support it, and in any case the Ruby bindings (https://github.com/watsonbox/pocketsphinx-ruby) don't even use it.

Use the SoundSwallower Cython code as a starting point
@dhdaines dhdaines requested a review from lenzo-ka July 22, 2022 13:39
@dhdaines dhdaines changed the title Switch to Cython and scikit-build for Python Switch back to Cython and scikit-build for Python module Jul 22, 2022
Copy link
Contributor

@lenzo-ka lenzo-ka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

int ps_reinit_feat(ps_decoder_t *ps, cmd_ln_t *config)
logmath_t *ps_get_logmath(ps_decoder_t *ps)
int ps_start_stream(ps_decoder_t *ps)
int ps_get_in_speech(ps_decoder_t *ps)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you expose get_in_speech as well? That would let you do some nice things like keep a mic open but discard the. audio up to x msec before speech starts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, funny you mention this, because I had removed get_in_speech as the internal VAD, which it used, was buggy and also not a very good VAD. do you have code that uses it already? I am trying to figure out what exactly the use case is for it and whether it can be supported or not...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No -- and actually we can just check if there are word in the hyp, so I wouldn't worry about it

@dhdaines dhdaines changed the title Switch back to Cython and scikit-build for Python module Switch back to Cython and use scikit-build for Python module Jul 22, 2022
@dhdaines dhdaines merged commit 708a5c1 into master Jul 22, 2022
@dhdaines dhdaines deleted the cython_module branch September 21, 2022 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants