Speech recognition addon: ofxASR

I’m glad to announce that the addon ofxASR v0.10 is avilable.

ofxASR is an openframeworks addon for speech recognition. It is designed to help people to develop applications with speech recognition feature easily.

Please visit http://code.google.com/p/ofxasr/ to download and try it.

Currently only the windows version was available. The support for OSX and Linux will be added in 2 or 3 days.

This is amazing, so excited to try this out on OSX. I’ve been working with Sphinx and Julius a fair amount but ran into big problems with Julius on 10.6. Any thoughts of integrating Julius by any chance?

This addon is designed that it can use kinds of engines, and provide the same interface for developers.

However, the main target at present is to make a version that is stable and easy to use. Other kinds of engines will be integrated in future.

:slight_smile:

[quote author=“julapy”]hi, ive downloaded ofxASR version 0.1 from => http://code.google.com/p/ofxasr/downloads/

there don’t appear to be any sphinx libraries included in the osx folder…

would you be able to post some instructions on how to get the example working on OSX?

thx, L.[/quote]

sorry, the version you just downloaded is not support osx.

Now I have uploaded a new version(0.11) with libs for osx and linux, here is the download link:
http://code.google.com/p/ofxasr/downloa-…-.11.tar.gz

The install.xml file in the packet showed which folder need to be added to the include search path, which static lib should be link, and which dylib should be copied.

Note that OS X did not allow record sound in sample rate 16k directly, but most sphinx model is in sample rate 16k. So you may need do some sample rate convert.

Although the newest release provided sphinx libs for osx and linux, but i have only tested this addon on win32 platform.

There may be some problem if use this addon on osx or linux, even it can’t pass the compile (i have not test it so i’m not sure).

Can anybody check it out and debug it on osx or linux? http://code.google.com/p/ofxasr/source/checkout

BTW, the libs for linux and osx are much bigger than libs for win. I’m not sure why.

:slight_smile:

On OSX 10.6 I needed to change the itoa to sprintf (Linux will need the same). I’m getting these linking errors on the .a files

ld: warning: in /Users/base/openframeworks/of_061/addons/ofxASR/libs/sphinx/lib/linux/libs3decoder.so, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /Users/base/openframeworks/of_061/addons/ofxASR/libs/sphinx/lib/linux/libsphinxbase.so, file was built for unsupported file format which is not the architecture being linked (i386)

It’s been compiled for a different architecture.

[quote author=“joshuajnoble”]On OSX 10.6 I needed to change the itoa to sprintf (Linux will need the same). I’m getting these linking errors on the .a files

ld: warning: in /Users/base/openframeworks/of_061/addons/ofxASR/libs/sphinx/lib/linux/libs3decoder.so, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /Users/base/openframeworks/of_061/addons/ofxASR/libs/sphinx/lib/linux/libsphinxbase.so, file was built for unsupported file format which is not the architecture being linked (i386)

It’s been compiled for a different architecture.[/quote]

Thank you for your testing.

This addon needs libs3decoder and libsphinxbase.
I compiled libs3decoder and libsphinxbase on OSX 10.6 and Ubuntu 10.04.

The s3decoder.dll and sphinxbase.dll that I compiled on vs2008/winxp are worked fine, but I’m not sure if I compiled them correctly on OSX and linux.

Could you try to complie sphinxbase and sphinx3 for your architecture?
sphinxbase: http://sourceforge.net/projects/cmusphi-…-nxbase/0.6
sphinx3: http://sourceforge.net/projects/cmusphi-…-phinx3/0.8

If you can get it work on osx or linux, do tell me please. I really appreciate it. :slight_smile:

The problem is snow leopard is that libraries are compiled by default for 64bits but OF is compiled for 32. The easiest way is to compile them with an older osx.

If the library has a configure script try with

export CFLAGS=-m32
./configure

[quote author=“arturo”]The problem is snow leopard is that libraries are compiled by default for 64bits but OF is compiled for 32. The easiest way is to compile them with an older osx.

If the library has a configure script try with

export CFLAGS=-m32
./configure[/quote]

thank you~
the download package has been updated:
http://code.google.com/p/ofxasr/downloa-…-.12.tar.gz

any feedback is welcome. :slight_smile:

I tried bullding on mac against the 10.4 sdk with gcc 4.0. After adding the libs it seems to start to link against sphinx but fails midway with undefined symbols. what version of gcc are you using? I’m not familiar with memset_chk but it seems it may be part of gcc libs?

Also tried doing 10.5/4.2 but that caused a bunch of other compile errors as some of the sphinx headers appear to be not compatible

Here’s the ld output:

  
  
Ld /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/bin//emptyExampleDebug.app/Contents/MacOS/emptyExampleDebug normal i386  
    cd /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample  
    setenv MACOSX_DEPLOYMENT_TARGET 10.4  
    /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -L/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/bin -L/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/freeimage/lib/osx -L/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/FreeImage/lib/osx -L/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../addons/ofxASR/libs/sphinx/lib/osx -L/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/GLee/lib/osx -L/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/poco/lib/osx -L/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/rtAudio/lib/osx -L/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/fmodex/lib/osx -L/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/freetype/lib/osx -L/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/FreeImage/lib/osx -L/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../addons/ofxASR/libs/sphinx/lib/osx -L/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../addons/ofxASR/libs/sphinx/lib/osx -F/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/bin -F/Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/glut/lib/osx -filelist /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/build/emptyExample.build/Debug/emptyExample.build/Objects-normal/i386/emptyExampleDebug.LinkFileList -mmacosx-version-min=10.4 -Wl,-dead_strip /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../addons/ofxASR/libs/sphinx/lib/osx/libs3decoder.a /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../addons/ofxASR/libs/sphinx/lib/osx/libsphinxbase.a /Users/admin/of/of_preRelease_v0061_osx_FAT/libs/openFrameworksCompiled/lib/osx/openFrameworksDebug.a /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/GLee/lib/osx/GLee.a /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/rtAudio/lib/osx/rtAudio.a -framework AGL -framework ApplicationServices -framework AudioToolbox -framework Carbon -framework CoreAudio -framework CoreFoundation -framework CoreServices -framework OpenGL -framework QuickTime -framework AppKit -framework Cocoa -framework IOKit -framework GLUT /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/poco/lib/osx/CppUnit.a /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/poco/lib/osx/PocoFoundation.a /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/poco/lib/osx/PocoNet.a /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/poco/lib/osx/PocoUtil.a /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/poco/lib/osx/PocoXML.a /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/freetype/lib/osx/freetype.a -lfmodex /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/../../../libs/FreeImage/lib/osx/freeimage.a -lsphinxbase -ls3decoder -o /Users/admin/of/of_preRelease_v0061_osx_FAT/apps/examples/asrexample/bin//emptyExampleDebug.app/Contents/MacOS/emptyExampleDebug  
Undefined symbols:  
  "___memset_chk", referenced from:  
      _yyensure_buffer_stack in libsphinxbase.a(jsgf_scanner.o)  
      _yyensure_buffer_stack in libsphinxbase.a(jsgf_scanner.o)  
      ___inline_memset_chk in libsphinxbase.a(jsgf_scanner.o)  
      _yylex_init in libsphinxbase.a(jsgf_scanner.o)  
      _kb_init in libs3decoder.a(kb.o)  
      ___inline_memset_chk in libs3decoder.a(kb.o)  
      _cmn in libsphinxbase.a(cmn.o)  
      _cmn in libsphinxbase.a(cmn.o)  
      ___inline_memset_chk in libsphinxbase.a(cmn.o)  
      _feat_lda_transform in libsphinxbase.a(lda.o)  
      ___inline_memset_chk in libsphinxbase.a(lda.o)  
      _invert in libsphinxbase.a(matrix.o)  
      ___inline_memset_chk in libsphinxbase.a(matrix.o)  
      _s2_semi_mgau_frame_eval in libs3decoder.a(s2_semi_mgau.o)  
      ___inline_memset_chk in libs3decoder.a(s2_semi_mgau.o)  
      _ascr_clear_sen_active in libs3decoder.a(ascr.o)  
      ___inline_memset_chk in libs3decoder.a(ascr.o)  
      _ascr_clear_ssid_active in libs3decoder.a(ascr.o)  
      _ascr_clear_comssid_active in libs3decoder.a(ascr.o)  
      _fe_start_utt in libsphinxbase.a(fe_interface.o)  
      ___inline_memset_chk in libsphinxbase.a(fe_interface.o)  
      _fe_spch_to_frame in libsphinxbase.a(fe_sigproc.o)  
      ___inline_memset_chk in libsphinxbase.a(fe_sigproc.o)  
      _hmm_init in libs3decoder.a(hmm.o)  
      ___inline_memset_chk in libs3decoder.a(hmm.o)  
      _psubtree_add_trans in libs3decoder.a(fsg_psubtree.o)  
      ___inline_memset_chk in libs3decoder.a(fsg_psubtree.o)  
      _lattice_entry in libs3decoder.a(vithist.o)  
      ___inline_memset_chk in libs3decoder.a(vithist.o)  
      _enter_lm_words in libs3decoder.a(flat_fwd.o)  
      ___inline_memset_chk in libs3decoder.a(flat_fwd.o)  
      _srch_TST_set_lm in libs3decoder.a(srch_time_switch_tree.o)  
      ___inline_memset_chk in libs3decoder.a(srch_time_switch_tree.o)  
  "___stack_chk_fail", referenced from:  
      _arg_resolve_env in libsphinxbase.a(cmd_ln.o)  
      _bcomment_read in libsphinxbase.a(bio.o)  
      _bio_readhdr in libsphinxbase.a(bio.o)  
      _triphone_add in libs3decoder.a(mdef.o)  
      _parse_tmat_senmap in libs3decoder.a(mdef.o)  
      _parse_base_line in libs3decoder.a(mdef.o)  
      _parse_tri_line in libs3decoder.a(mdef.o)  
      _mdef_init in libs3decoder.a(mdef.o)  
      _read_sendump in libs3decoder.a(s2_semi_mgau.o)  
      _read_tree_int in libs3decoder.a(kdtree.o)  
      _read_tree_float in libs3decoder.a(kdtree.o)  
      _read_bbi_list in libs3decoder.a(kdtree.o)  
      _read_kd_trees in libs3decoder.a(kdtree.o)  
      _dict_read in libs3decoder.a(dict.o)  
      _dict_init in libs3decoder.a(dict.o)  
      _subvq_init in libs3decoder.a(subvq.o)  
      _lmset_read_ctl in libs3decoder.a(lmset.o)  
      _lm_read_dump_header in libs3decoder.a(lm_3g_dmp.o)  
      _lm_read_lmfilename in libs3decoder.a(lm_3g_dmp.o)  
      _lm_read_dump_ver_nug in libs3decoder.a(lm_3g_dmp.o)  
      _ReadNgramCounts in libs3decoder.a(lm_3g.o)  
      _ReadUnigrams in libs3decoder.a(lm_3g.o)  
      _ReadBigrams in libs3decoder.a(lm_3g.o)  
      _ReadTrigrams in libs3decoder.a(lm_3g.o)  
      _lts_apply in libs3decoder.a(lts.o)  
      _lmclass_loadfile in libs3decoder.a(lmclass.o)  
      _fillpen_init in libs3decoder.a(fillpen.o)  
      _fe_warp_inverse_linear_set_parameters in libsphinxbase.a(fe_warp_inverse_linear.o)  
      _fe_warp_affine_set_parameters in libsphinxbase.a(fe_warp_affine.o)  
      _fe_warp_piecewise_linear_set_parameters in libsphinxbase.a(fe_warp_piecewise_linear.o)  
      _srch_utt_end in libs3decoder.a(srch.o)  
      _write_phseg in libs3decoder.a(srch_allphone.o)  
      _srch_allphone_nbest_impl in libs3decoder.a(srch_allphone.o)  
      _dag_write_header in libs3decoder.a(dag.o)  
      _fsg_search_utt_end in libs3decoder.a(fsg_search.o)  
      _word_fsg_read in libs3decoder.a(word_fsg.o)  
      _srch_FLAT_FWD_begin in libs3decoder.a(srch_flat_fwd.o)  
      _srch_FLAT_FWD_dump_vithist in libs3decoder.a(srch_flat_fwd.o)  
      _srch_FLAT_FWD_dag_dump in libs3decoder.a(srch_flat_fwd.o)  
      _srch_FLAT_FWD_nbest_impl in libs3decoder.a(srch_flat_fwd.o)  
      _word_cand_load in libs3decoder.a(flat_fwd.o)  
      _srch_TST_nbest_impl in libs3decoder.a(srch_time_switch_tree.o)  
  "___strncat_chk", referenced from:  
      _strnappend in libsphinxbase.a(cmd_ln.o)  
      ___inline_strncat_chk in libsphinxbase.a(cmd_ln.o)  
  "___strncpy_chk", referenced from:  
      _arg_resolve_env in libsphinxbase.a(cmd_ln.o)  
      _cst_substr in libs3decoder.a(lts.o)  
      ___inline_strncpy_chk in libs3decoder.a(lts.o)  
  "_open$UNIX2003", referenced from:  
      _mmio_file_read in libsphinxbase.a(mmio.o)  
  "_strerror$UNIX2003", referenced from:  
      _jsgf_parse_file in libsphinxbase.a(jsgf.o)  
      __E__fatal_sys_error in libsphinxbase.a(err.o)  
      __E__sys_error in libsphinxbase.a(err.o)  
      _fsg_model_writefile in libsphinxbase.a(fsg_model.o)  
      _feat_read_lda in libsphinxbase.a(lda.o)  
  "_close$UNIX2003", referenced from:  
      _mmio_file_read in libsphinxbase.a(mmio.o)  
  "___stack_chk_guard", referenced from:  
      ___stack_chk_guard$non_lazy_ptr in libsphinxbase.a(cmd_ln.o)  
  "_fputs$UNIX2003", referenced from:  
      _arg_dump_r in libsphinxbase.a(cmd_ln.o)  
      _arg_dump_r in libsphinxbase.a(cmd_ln.o)  
      _arg_dump_r in libsphinxbase.a(cmd_ln.o)  
      _arg_dump_r in libsphinxbase.a(cmd_ln.o)  
      _arg_dump_r in libsphinxbase.a(cmd_ln.o)  
      _lextree_node_print in libs3decoder.a(lextree.o)  
      _match_write in libs3decoder.a(srch_output.o)  
  "___memmove_chk", referenced from:  
      _apply_model in libs3decoder.a(lts.o)  
      _apply_model in libs3decoder.a(lts.o)  
      _fe_process_frames in libsphinxbase.a(fe_interface.o)  
      ___inline_memmove_chk in libsphinxbase.a(fe_interface.o)  
      _fe_shift_frame in libsphinxbase.a(fe_sigproc.o)  
      ___inline_memmove_chk in libsphinxbase.a(fe_sigproc.o)  
  "___sprintf_chk", referenced from:  
      _jsgf_fullname in libsphinxbase.a(jsgf.o)  
      _jsgf_fullname_from_rule in libsphinxbase.a(jsgf.o)  
      _jsgf_define_rule in libsphinxbase.a(jsgf.o)  
      _s3_decode_set_uttid in libs3decoder.a(s3_decode.o)  
      _mdef_phone_str in libs3decoder.a(mdef.o)  
      _mdef_phone_str in libs3decoder.a(mdef.o)  
      _lts_apply in libs3decoder.a(lts.o)  
      _lts_apply in libs3decoder.a(lts.o)  
      _lts_apply in libs3decoder.a(lts.o)  
      _srch_utt_end in libs3decoder.a(srch.o)  
      _write_phseg in libs3decoder.a(srch_allphone.o)  
      _fsg_search_utt_end in libs3decoder.a(fsg_search.o)  
      _srch_FLAT_FWD_dump_vithist in libs3decoder.a(srch_flat_fwd.o)  
      _srch_TST_dump_vithist in libs3decoder.a(srch_time_switch_tree.o)  
  "___memcpy_chk", referenced from:  
      _multadd in libsphinxbase.a(dtoa.o)  
      ___inline_memcpy_chk in libsphinxbase.a(dtoa.o)  
      _sb_strtod in libsphinxbase.a(dtoa.o)  
      _cmd_ln_val_init in libsphinxbase.a(cmd_ln.o)  
      ___inline_memcpy_chk in libsphinxbase.a(cmd_ln.o)  
      _parse_options in libsphinxbase.a(cmd_ln.o)  
      _feat_subvec_project in libsphinxbase.a(feat.o)  
      ___inline_memcpy_chk in libsphinxbase.a(feat.o)  
      _feat_s2_4x_cep2feat in libsphinxbase.a(feat.o)  
      _feat_s3_1x39_cep2feat in libsphinxbase.a(feat.o)  
      _feat_s3_cep in libsphinxbase.a(feat.o)  
      _feat_s3_cep_dcep in libsphinxbase.a(feat.o)  
      _feat_1s_c_d_dd_cep2feat in libsphinxbase.a(feat.o)  
      _feat_1s_c_d_ld_dd_cep2feat in libsphinxbase.a(feat.o)  
      _feat_copy in libsphinxbase.a(feat.o)  
      _feat_s2mfc2feat_block_utt in libsphinxbase.a(feat.o)  
      _feat_s2mfc2feat_block_utt in libsphinxbase.a(feat.o)  
      _feat_s2mfc2feat_block_utt in libsphinxbase.a(feat.o)  
      _feat_lda_transform in libsphinxbase.a(lda.o)  
      ___inline_memcpy_chk in libsphinxbase.a(lda.o)  
      _sseq_compress in libs3decoder.a(mdef.o)  
      ___inline_memcpy_chk in libs3decoder.a(mdef.o)  
      _mgau_uninit_compact in libs3decoder.a(cont_mgau.o)  
      _mgau_uninit_compact in libs3decoder.a(cont_mgau.o)  
      _mgau_uninit_compact in libs3decoder.a(cont_mgau.o)  
      ___inline_memcpy_chk in libs3decoder.a(cont_mgau.o)  
      _determinant in libsphinxbase.a(matrix.o)  
      ___inline_memcpy_chk in libsphinxbase.a(matrix.o)  
      _invert in libsphinxbase.a(matrix.o)  
      _eval_cb_kdtree in libs3decoder.a(s2_semi_mgau.o)  
      ___inline_memcpy_chk in libs3decoder.a(s2_semi_mgau.o)  
      _eval_cb in libs3decoder.a(s2_semi_mgau.o)  
      _s2_semi_mgau_frame_eval in libs3decoder.a(s2_semi_mgau.o)  
      _read_bbi_list in libs3decoder.a(kdtree.o)  
      ___inline_memcpy_chk in libs3decoder.a(kdtree.o)  
      _dict_add_word in libs3decoder.a(dict.o)  
      ___inline_memcpy_chk in libs3decoder.a(dict.o)  
      _compress_right_context_tree in libs3decoder.a(dict2pid.o)  
      _compress_right_context_tree in libs3decoder.a(dict2pid.o)  
      ___inline_memcpy_chk in libs3decoder.a(dict2pid.o)  
      _compress_left_right_context_tree in libs3decoder.a(dict2pid.o)  
      _compress_left_right_context_tree in libs3decoder.a(dict2pid.o)  
      _fe_process_frames in libsphinxbase.a(fe_interface.o)  
      _fe_process_frames in libsphinxbase.a(fe_interface.o)  
      _fe_process_frames in libsphinxbase.a(fe_interface.o)  
      _fe_process_frames in libsphinxbase.a(fe_interface.o)  
      ___inline_memcpy_chk in libsphinxbase.a(fe_interface.o)  
      _fe_read_frame in libsphinxbase.a(fe_sigproc.o)  
      ___inline_memcpy_chk in libsphinxbase.a(fe_sigproc.o)  
      _fe_shift_frame in libsphinxbase.a(fe_sigproc.o)  
      _path2dirname in libsphinxbase.a(filename.o)  
      ___inline_memcpy_chk in libsphinxbase.a(filename.o)  
      _srch_FSG_gen_hyp in libs3decoder.a(srch_fsg.o)  
      ___inline_memcpy_chk in libs3decoder.a(srch_fsg.o)  
      _build_lcssid in libs3decoder.a(ctxt_table.o)  
      ___inline_memcpy_chk in libs3decoder.a(ctxt_table.o)  
      _build_rcssid in libs3decoder.a(ctxt_table.o)  
  "_fstat$INODE64", referenced from:  
      _mmio_file_read in libsphinxbase.a(mmio.o)  
  "_fopen$UNIX2003", referenced from:  
      _path_list_search in libsphinxbase.a(jsgf.o)  
      _jsgf_parse_file in libsphinxbase.a(jsgf.o)  
      _fsg_model_writefile in libsphinxbase.a(fsg_model.o)  
      _cmd_ln_parse_file_r in libsphinxbase.a(cmd_ln.o)  
      _file_open in libs3decoder.a(kb.o)  
      _file_exists in libs3decoder.a(kbcore.o)  
      _feat_read_lda in libsphinxbase.a(lda.o)  
      _mdef_init in libs3decoder.a(mdef.o)  
      _mgau_file_read in libs3decoder.a(cont_mgau.o)  
      _mgau_mixw_read in libs3decoder.a(cont_mgau.o)  
      _read_sendump in libs3decoder.a(s2_semi_mgau.o)  
      _read_mixw in libs3decoder.a(s2_semi_mgau.o)  
      _s3_read_mgau in libs3decoder.a(s2_semi_mgau.o)  
      _read_kd_trees in libs3decoder.a(kdtree.o)  
      _gauden_param_read in libs3decoder.a(ms_gauden.o)  
      _senone_mgau_map_read in libs3decoder.a(ms_senone.o)  
      _senone_mixw_read in libs3decoder.a(ms_senone.o)  
      _interp_read in libs3decoder.a(interp.o)  
      _tmat_init in libs3decoder.a(tmat.o)  
      _dict_init in libs3decoder.a(dict.o)  
      _dict_init in libs3decoder.a(dict.o)  
      _subvq_init in libs3decoder.a(subvq.o)  
      _gs_read in libs3decoder.a(gs.o)  
      _lmset_read_ctl in libs3decoder.a(lmset.o)  
      _lm_read_dump in libs3decoder.a(lm_3g_dmp.o)  
      _fopen_comp in libsphinxbase.a(pio.o)  
      _lmclass_loadfile in libs3decoder.a(lmclass.o)  
      _fillpen_init in libs3decoder.a(fillpen.o)  
      _mllr_read_regmat in libs3decoder.a(mllr.o)  
      _s3map_read in libs3decoder.a(cb2mllr_io.o)  
      _ms_mllr_read_regmat in libs3decoder.a(ms_mllr.o)  
      _write_phseg in libs3decoder.a(srch_allphone.o)  
      _fsg_search_utt_end in libs3decoder.a(fsg_search.o)  
      _word_fsg_readfile in libs3decoder.a(word_fsg.o)  
      _srch_FLAT_FWD_dump_vithist in libs3decoder.a(srch_flat_fwd.o)  
      _srch_TST_dump_vithist in libs3decoder.a(srch_time_switch_tree.o)  
  "___strcat_chk", referenced from:  
      _jsgf_import_rule in libsphinxbase.a(jsgf.o)  
      ___inline_strcat_chk in libsphinxbase.a(jsgf.o)  
      _string_join in libsphinxbase.a(strfuncs.o)  
      ___inline_strcat_chk in libsphinxbase.a(strfuncs.o)  
      _s3_decode_record_hyps in libs3decoder.a(s3_decode.o)  
      ___inline_strcat_chk in libs3decoder.a(s3_decode.o)  
      _ctl_outfile in libs3decoder.a(corpus.o)  
      _ctl_outfile in libs3decoder.a(corpus.o)  
      ___inline_strcat_chk in libs3decoder.a(corpus.o)  
  "___strcpy_chk", referenced from:  
      _jsgf_import_rule in libsphinxbase.a(jsgf.o)  
      ___inline_strcpy_chk in libsphinxbase.a(jsgf.o)  
      ___ckd_salloc__ in libsphinxbase.a(ckd_alloc.o)  
      ___inline_strcpy_chk in libsphinxbase.a(ckd_alloc.o)  
      _string_join in libsphinxbase.a(strfuncs.o)  
      ___inline_strcpy_chk in libsphinxbase.a(strfuncs.o)  
      _s3_decode_set_uttid in libs3decoder.a(s3_decode.o)  
      ___inline_strcpy_chk in libs3decoder.a(s3_decode.o)  
      _kb_setmllr in libs3decoder.a(kb.o)  
      ___inline_strcpy_chk in libs3decoder.a(kb.o)  
      _lmset_read_ctl in libs3decoder.a(lmset.o)  
      _fopen_compchk in libsphinxbase.a(pio.o)  
      _fopen_compchk in libsphinxbase.a(pio.o)  
      _fopen_compchk in libsphinxbase.a(pio.o)  
      _fopen_compchk in libsphinxbase.a(pio.o)  
      ___inline_strcpy_chk in libsphinxbase.a(pio.o)  
      _fe_warp_inverse_linear_set_parameters in libsphinxbase.a(fe_warp_inverse_linear.o)  
      _fe_warp_inverse_linear_set_parameters in libsphinxbase.a(fe_warp_inverse_linear.o)  
      _fe_warp_affine_set_parameters in libsphinxbase.a(fe_warp_affine.o)  
      _fe_warp_affine_set_parameters in libsphinxbase.a(fe_warp_affine.o)  
      _fe_warp_piecewise_linear_set_parameters in libsphinxbase.a(fe_warp_piecewise_linear.o)  
      _fe_warp_piecewise_linear_set_parameters in libsphinxbase.a(fe_warp_piecewise_linear.o)  
      ___inline_strcpy_chk in libs3decoder.a(corpus.o)  
      _ctl_outfile in libs3decoder.a(corpus.o)  
      _ctl_outfile in libs3decoder.a(corpus.o)  
      _ctl_outfile in libs3decoder.a(corpus.o)  
      _ctl_outfile in libs3decoder.a(corpus.o)  
      _ctl_outfile in libs3decoder.a(corpus.o)  
      _lextree_init in libs3decoder.a(lextree.o)  
      ___inline_strcpy_chk in libs3decoder.a(lextree.o)  
      _lextree_utt_end in libs3decoder.a(lextree.o)  
  "_popen$UNIX2003", referenced from:  
      _fopen_comp in libsphinxbase.a(pio.o)  
      _fopen_comp in libsphinxbase.a(pio.o)  
ld: symbol(s) not found  
collect2: ld returned 1 exit status  
  

On OSX 10.6 after commenting out uint64

  
//typedef double          uint64;  

It compiles fine but throws the following:

  
  
run  
[Switching to process 5949]  
Running
  
dyld: Library not loaded: /usr/local/lib/libs3decoder.0.dylib  
  Referenced from: /Users/base/openframeworks/of_061/apps/testing/ofxasr_test/bin/audioInputExampleDebug.app/Contents/MacOS/audioInputExampleDebug  
  Reason: image not found  
sharedlibrary apply-load-rules all  
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib")  
Cannot access memory at address 0x0  
Cannot access memory at address 0x0  
  
  

I believe you’re getting this error because there is an xcode bug to always dynamically link if it can find the .dylib file (for more info see http://blog.yimingliu.com/2008/09/09/pe-…-ib-fetish/) jimbozhang: The .a adds are supposed to be static linked, correct?

I got past that by deleting/moving the dylibs for the sphinx .a adds and rebuilding. I remember in xcode 2.5 I needed to delete references by editing the project.pbproj file as text.

[quote author=“joshuajnoble”]On OSX 10.6 …
It compiles fine but throws the following:

[/code]
[/quote]

Please try http://code.google.com/p/ofxasr/downloa-…-akechanges , it provided a xcode project.

A problem is the sphinx acoustics model in the package is 16000 sample rate, while os x do not support such a low rate. So I have to record in 48000 sample rate and down-resample. I’m not sure if there is something wrong in the resampling…

I have been working with ofxSpeech - which extends the built in speech recognition in Cocoa Framework. It’s pretty inconsistant even with an external mic. Are you guys looking into this because it will work significantly better? I know MacSpeech and Dragon Natural Speech are great when you do hacky stuff, like text capture from a window and send it over a socket, but I’ve been looking for something for OSX that will integrate more seamlessly. I’ll keep looking at this thread - it would be great if someone gets it to compile in 10.6.

ofxSpeech uses OSX’s speech API, so it can not be used on other platforms. ofxASR use CMU Sphinx instead, which is cross platform.

Now ofxASR has been complied successfully on 10.6, please check http://code.google.com/p/ofxasr/downloa-…-akechanges , it provided a complete xcode project with oF 0.61.

A problem is still exist: It can be complied on 10.6, but it always gives wrong result (the result on windows is correct). The reason is the unmatch sample rate. The sphinx resource shipped in the project require 16000 sample rate, but os x do not support such a low rate. Seems the converting code is not correct. It will be great if anyone can provide useable samplerate converting code for it.

I’ve tried working with http://www.mega-nerd.com/SRC/ to fix this problem but never got it working realtime but that was a while ago. I’d imagine someone a little more savvy with audio buffers and how to tie those into sphinx would do better.

If you want to post your code using libresample, I’ll take a look.

Thank you~
Please check http://code.google.com/p/ofxasr/downloa-…-akechanges
It is a xcode project that has integrated libresample.
:slight_smile:

On Code::Blocks 10.05 / GNU GCC Compiler 3.4.5 on Windows 7 (64-bit). Everything compiles and then I get this:

obj\debug\addons\ofxASR\src\ofxSphinxASR.o In function \_ZN12ofxSphinxASR10engineInitEP15ofAsrEngineArgs': C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 97 undefined reference to__imp__jsgf_parse_file’
C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 103 undefined reference to \_\_imp\_\_fsg\_model\_writefile' C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 104 undefined reference to__imp__fsg_model_free’
C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 105 undefined reference to \_\_imp\_\_jsgf\_grammar\_free' C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 113 undefined reference to__imp__err_set_logfp’
C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 115 undefined reference to \_\_imp\_\_S3\_DECODE\_ARG\_DEFS' C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 115 undefined reference to__imp__cmd_ln_parse_file_r’
C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 121 undefined reference to \_\_imp\_\_s3\_decode\_init' C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 123 undefined reference to__imp__fe_init_auto_r’

obj\debug\addons\ofxASR\src\ofxSphinxASR.o In function \_ZN12ofxSphinxASR10engineExitEv': C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 132 undefined reference to__imp__s3_decode_close’
C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 139 undefined reference to `__imp__fe_free’

obj\debug\addons\ofxASR\src\ofxSphinxASR.o In function \_ZN12ofxSphinxASR10engineOpenEv': C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 153 undefined reference to__imp__s3_decode_begin_utt’

obj\debug\addons\ofxASR\src\ofxSphinxASR.o In function \_ZN12ofxSphinxASR11engineCloseEv': C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 169 undefined reference to__imp__s3_decode_end_utt’

obj\debug\addons\ofxASR\src\ofxSphinxASR.o In function \_ZN12ofxSphinxASR15engineSentAudioEPsi': C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 181 undefined reference to__imp__fe_process_utt’
C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 183 undefined reference to \_\_imp\_\_s3\_decode\_process' C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 184 undefined reference to__imp__ckd_free_2d’

obj\debug\addons\ofxASR\src\ofxSphinxASR.o In function \_ZN12ofxSphinxASR13engineGetTextEv': C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 192 undefined reference to__imp__s3_decode_hypothesis’

obj\debug\addons\ofxASR\src\ofxSphinxASR.o In function \_ZN12ofxSphinxASR7get\_fsgEP6jsgf\_sPKc': C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 209 undefined reference to__imp__logmath_init’
C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 212 undefined reference to \_\_imp\_\_jsgf\_rule\_iter' C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 215 undefined reference to__imp__jsgf_rule_name’
C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 217 undefined reference to \_\_imp\_\_jsgf\_rule\_public' C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 220 undefined reference to__imp__logmath_retain’
C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 220 undefined reference to \_\_imp\_\_jsgf\_build\_fsg\_raw' C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 222 undefined reference to__imp__hash_table_iter_free’
C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 212 undefined reference to \_\_imp\_\_hash\_table\_iter\_next' C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 227 undefined reference to__imp__logmath_free’

And it won’t run…

Any ideas?

[quote author=“LetsGoOutside”]On Code::Blocks 10.05 / GNU GCC Compiler 3.4.5 on Windows 7 (64-bit). Everything compiles and then I get this:

obj\debug\addons\ofxASR\src\ofxSphinxASR.o In function \_ZN12ofxSphinxASR10engineInitEP15ofAsrEngineArgs': C:\Users\Stephen Schieberl\Documents\Code\ofx\addons\ofxASR\src\ofxSphinxASR.cpp 97 undefined reference to__imp__jsgf_parse_file’

And it won’t run…
Any ideas?
[/quote]

I’m not familar with Code::Blocks. But it seems you did not set the library “sphinxbase.lib” correctly.
jsgf_parse_file is a function in the library sphinxbase.