summaryrefslogtreecommitdiff
path: root/htk_io/src/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'htk_io/src/init.c')
-rw-r--r--htk_io/src/init.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/htk_io/src/init.c b/htk_io/src/init.c
index 8a1ec3b..a5132ba 100644
--- a/htk_io/src/init.c
+++ b/htk_io/src/init.c
@@ -1,4 +1,5 @@
-#include "nerv/common.h"
+#include "nerv/lib/common.h"
+#include "nerv/matrix/matrix.h"
#include "cwrapper.h"
#include <stdio.h>
@@ -28,12 +29,14 @@ static int feat_repo_current_tag(lua_State *L) {
}
static int feat_repo_current_utterance(lua_State *L) {
+ MContext *context;
+ MMATRIX_GET_CONTEXT(L, 3);
TNetFeatureRepo *repo = luaT_checkudata(L, 1, nerv_tnet_feat_repo_tname);
int debug;
if (!lua_isboolean(L, 2))
nerv_error(L, "debug flag should be a boolean");
debug = lua_toboolean(L, 2);
- Matrix *utter = tnet_feature_repo_read_utterance(repo, L, debug);
+ Matrix *utter = tnet_feature_repo_read_utterance(repo, L, debug, context);
luaT_pushudata(L, utter, nerv_matrix_host_float_tname);
return 1;
}
@@ -72,6 +75,8 @@ static int label_repo_new(lua_State *L) {
}
static int label_repo_read_utterance(lua_State *L) {
+ MContext *context;
+ MMATRIX_GET_CONTEXT(L, 5);
TNetLabelRepo *repo = luaT_checkudata(L, 1, nerv_tnet_label_repo_tname);
TNetFeatureRepo *feat_repo = luaT_checkudata(L, 2, nerv_tnet_feat_repo_tname);
size_t frames = luaL_checkinteger(L, 3);
@@ -82,7 +87,8 @@ static int label_repo_read_utterance(lua_State *L) {
Matrix *utter = tnet_label_repo_read_utterance(repo,
frames,
tnet_feature_repo_current_samplerate(feat_repo),
- tnet_feature_repo_current_tag(feat_repo), L, debug);
+ tnet_feature_repo_current_tag(feat_repo),
+ L, debug, context);
luaT_pushudata(L, utter, nerv_matrix_host_float_tname);
return 1;
}