Menu

cython bindings for continuous listener

Help
2012-05-04
2012-09-22
  • Scott Silliman

    Scott Silliman - 2012-05-04

    Hi,

    I'm VERY close to having cython bindings to the sphinxbase ad_rec and cont_ad
    APIs. The only problem is that in the cont_ad_t is considered opaque and thus,
    I can't access the read_ts attribute from the extension class I wrap it with.
    I can see 2 solutions to the problem:

    1) in the sphinxbase.pxd file, instead of merely stating

    cdef extern from "sphinxbase/cont_ad.h":
    ctypedef struct cont_ad_t

    I'd have to define all of the fields to cont_ad_t. I don't like this solution,
    because if there is a change to this structure in the .h file, the code will
    break

    2) add an accessor fuction, say cont_ad_get_read_ts() to cont_ad.h cont_ad.c,
    etc. which would only be necessary to use when creating bindings for scripting
    language wrappers

    I'm more comfortable with option 2. Do the developers have a preference for my
    upcoming patch?

    -Scott

     
  • Nickolay V. Shmyrev

    I'm more comfortable with option 2. Do the developers have a preference for
    my upcoming patch?

    I also like 2.

     
  • Scott Silliman

    Scott Silliman - 2012-05-10

    Thanks. I uploaded my patch last night. let me know what you think.

     

Log in to post a comment.