I am trying to implement the main function from sphinx_fe in an iOS app. I used the script to build for all of the architectures. I'm not getting any issues from the compiler.
Ultimately, when I call:
wtf->fe=fe_init_auto_r(config);
I get:
ERROR: "fe_interface.c", line 79: Frame rate -1975463840 can not be bigger than sample rate 0.00
The values for frame rate change with each call while the sample rate stays 0.00 even though I'm passing in 100 and 16000 respectively.
I know that the values in the config struct are being set properly, as I check them right before the fe_init_auto_r call. I use:
cmd_ln_str_r(config, "-frate")
I also tried to call fe_init_auto() instead, but ran into a seg fault ultimately from cmd_ln_retain. I tried using the x86_64 and i386 libraries for the iOS simulator.
Am I missing something obvious? Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Don't hurry and read my lips. frate has int type and samprate has float type. You can not use cmd_ln_str_r to read it. There is no type checking so you need to use proper function to set and read the values.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My apologies. Your help was spot on. I was setting the config struct using cmd_ln_init, but ultimately the defn header wasn't being included, so omitted parameters were not being initialized. In addition, the parameters provided were being stored as strings and not as their appropriate data types (hence the string retrieval method working). Thank you very much for your extremely fast responses.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to implement the main function from sphinx_fe in an iOS app. I used the script to build for all of the architectures. I'm not getting any issues from the compiler.
Ultimately, when I call:
I get:
The values for frame rate change with each call while the sample rate stays 0.00 even though I'm passing in 100 and 16000 respectively.
I know that the values in the config struct are being set properly, as I check them right before the fe_init_auto_r call. I use:
I also tried to call fe_init_auto() instead, but ran into a seg fault ultimately from cmd_ln_retain. I tried using the x86_64 and i386 libraries for the iOS simulator.
Am I missing something obvious? Thanks
samprate has float type, you need to use
cmd_ln_set_float32_randcmd_ln_float32_rto retrieve it.Fair, but that's not the issue. I just used that to verify that the proper values were being set in the config struct.
It appears that the fe_init_auto_r() function is looking somewhere else in memory.
Don't hurry and read my lips. frate has int type and samprate has float type. You can not use cmd_ln_str_r to read it. There is no type checking so you need to use proper function to set and read the values.
My apologies. Your help was spot on. I was setting the config struct using cmd_ln_init, but ultimately the defn header wasn't being included, so omitted parameters were not being initialized. In addition, the parameters provided were being stored as strings and not as their appropriate data types (hence the string retrieval method working). Thank you very much for your extremely fast responses.