spell action (like SayDigits)

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1348 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 18 years ago
parent a822abd436
commit 46a4b146ee

@ -58,6 +58,7 @@ DSMAction* SCUtilsModule::getAction(const string& from_str) {
DEF_CMD("utils.playCountRight", SCUPlayCountRightAction);
DEF_CMD("utils.playCountLeft", SCUPlayCountLeftAction);
DEF_CMD("utils.getNewId", SCGetNewIdAction);
DEF_CMD("utils.spell", SCUSpellAction);
return NULL;
}
@ -143,3 +144,14 @@ EXEC_ACTION_START(SCGetNewIdAction) {
string d = resolveVars(arg, sess, sc_sess, event_params);
sc_sess->var[d]=AmSession::getNewId();
} EXEC_ACTION_END;
CONST_ACTION_2P(SCUSpellAction, ',', true);
EXEC_ACTION_START(SCUSpellAction) {
string basedir = resolveVars(par2, sess, sc_sess, event_params);
string play_string = resolveVars(par1, sess, sc_sess, event_params);
DBG("spelling '%s'\n", play_string.c_str());
for (size_t i=0;i<play_string.length();i++)
sc_sess->playFile(basedir+play_string[i]+".wav", false);
} EXEC_ACTION_END;

@ -42,5 +42,5 @@ class SCUtilsModule
DEF_ACTION_2P(SCUPlayCountRightAction);
DEF_ACTION_2P(SCUPlayCountLeftAction);
DEF_ACTION_1P(SCGetNewIdAction);
DEF_ACTION_2P(SCUSpellAction);
#endif

@ -1,8 +1,16 @@
Actions:
utils.getNewId(string varname)
-- play count for laguages that have single digits after the 10s (like english)
utils.playCountRight(int cnt [, string basedir)
utils.playCountRight(int cnt [, string basedir])
-- play count for laguages that have single digits befire the 10s (like german)
utils.playCountLeft(int cnt [, string basedir)
utils.playCountLeft(int cnt [, string basedir])
utils.spell(string word[, string basedir])
plays each character in the word (e.g. utils.spell(321,wav/digits/) plays
wav/digits/3.wav, wav/digits/2.wav, wav/digits/1.wav
like SayDigits
SCUSpellAction
Conditions:

Loading…
Cancel
Save