From 39b1967870e6fabe6764360bccefad8a2a9db24d Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 24 Feb 2016 17:00:40 +0800 Subject: adjust the code according to the changes made in nerv/wrapped-handles --- htk_io/src/init.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'htk_io/src/init.c') 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 @@ -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; } -- cgit v1.2.3