~jbicha/hud/build-depend-on-valac-not-gir

« back to all changes in this revision

Viewing changes to src/hudsphinx.c

  • Committer: Tarmac
  • Author(s): Pete Woods
  • Date: 2013-05-08 09:35:09 UTC
  • mfrom: (252.1.1 voice-bug-1177226)
  • Revision ID: tarmac-20130508093509-2dozc2sdla7wy3tr
Fix voice on the device

Have to duplicate the call to cmd_ln_init to handle each case, it won't accept NULL arguments. Fixes: https://bugs.launchpad.net/bugs/1177226.

Approved by Albert Astals Cid, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
  gchar *hmm = "/usr/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k";
123
123
  gchar *dict = "/usr/share/pocketsphinx/model/lm/en_US/cmu07a.dic";
124
124
 
125
 
  self->config = cmd_ln_init(NULL, sphinx_cmd_ln, TRUE,
126
 
                                     "-hmm", hmm,
127
 
                                     "-dict", dict,
128
 
                                     "-adcdev", device == NULL ? "" : device,
129
 
                                     NULL);
 
125
  if (device != NULL) { 
 
126
    self->config = cmd_ln_init(NULL, sphinx_cmd_ln, TRUE,
 
127
                                     "-hmm", hmm,
 
128
                                     "-dict", dict,
 
129
                                     "-adcdev", device,
 
130
                                     NULL);
 
131
  } else {
 
132
    self->config = cmd_ln_init(NULL, sphinx_cmd_ln, TRUE,
 
133
                                     "-hmm", hmm,
 
134
                                     "-dict", dict,
 
135
                                     NULL);
 
136
  }
130
137
 
131
138
  if (self->config == NULL) {
132
139
    g_warning("Sphinx command line arguments failed to initialize");