VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
gregt at cgicommunicat... Guest
|
Posted: Wed Jul 29, 2009 3:33 pm Post subject: [Freeswitch-users] Stumped on speech recognition |
|
|
Still stumped on trying to write a streamlined pocketsphinx speech recognition. I went through SpeechTools.jm and I think I pulled out the necessary pieces, but the speech event is not being fired. I get dtmf events if I push a key, but not speech. I must be missing a piece, but I have stared at SpeechTools.jm until I can't see straight. Here is my code:
function onInput(s, type, inputEvent, _this) {
console_log("debug", "EVENT:" + type + "\n");
}
session.answer();
var blankobj = new Object();
var rv;
var hit;
var dup;
var grammar_name="pizza_yesno";
var collected_index=0;
var req=1;
var obj_path="result";
var halt=true;
var min_score=20;
var confirm_score=10;
console_log('INFO', "Setting grammar\n");
session.execute("detect_speech", "nogrammar " + grammar_name);
session.execute("detect_speech", "pocketsphinx " + grammar_name);
session.execute("detect_speech", "resume");
console_log('INFO', "entering while loop\n");
session.streamFile( "audiofile.wav", onInput, "blankobj") ;
while(session.ready() && collected_index < req) {
var x;
if (!rv) {
rv = session.collectInput(onInput, "blankobj", 500);
if (rv && !rv[0]) {
rv = false;
}
}
if (!rv) {
session.execute("detect_speech", "resume");
rv = session.collectInput(onInput, "blankobj", 5000);
}
hit = false;
if (rv) {
var items = rv;
rv = undefined;
for (y = 0; y < items.length; y++) {
console_log("debug", "---- "+items[y]+"\n");
}
}
if (!rv) {
rv = session.collectInput(onInput, "blankobj", 1000);
}
}
////////////////////////////////////////////
////////////////////////////////////////////
And here is some of the output from the console:
2009-07-29 16:10:09 [INFO] stest-examp.js:1 console_log() Setting grammar
EXECUTE sofia/internal/+*@199.173.94.88 ([email]sofia/internal/+*@199.173.94.88[/email]):5060 detect_speech(nogrammar pizza_yesno)
EXECUTE sofia/internal/+*@199.173.94.88 ([email]sofia/internal/+*@199.173.94.88[/email]):5060 detect_speech(pocketsphinx pizza_yesno)
EXECUTE sofia/internal/+*@199.173.94.88 ([email]sofia/internal/+*@199.173.94.88[/email]):5060 detect_speech(resume)
2009-07-29 16:10:09 [INFO] stest-examp.js:1 console_log() entering while loop
2009-07-29 16:10:09 [DEBUG] switch_ivr_play_say.c:1084 switch_ivr_play_file() Codec Activated L16@8000hz 1 channels 20ms
2009-07-29 16:10:09 [DEBUG] switch_core_io.c:649 switch_core_session_write_frame() sofia/internal/+*@199.173.94.88 ([email]sofia/internal/+*@199.173.94.88[/email]):5060 receive message [TRANSCODING_NECESSARY]
2009-07-29 16:10:09 [DEBUG] sofia.c:2979 sofia_handle_sip_i_state() Channel sofia/internal/+*@199.173.94.88 ([email]sofia/internal/+*@199.173.94.88[/email]):5060 entering state [ready][200]
2009-07-29 16:10:12 [DEBUG] switch_ivr_play_say.c:1379 switch_ivr_play_file() done playing file
EXECUTE sofia/internal/+*@199.173.94.88 ([email]sofia/internal/+*@199.173.94.88[/email]):5060 detect_speech(resume)
2009-07-29 16:10:16 [DEBUG] switch_rtp.c:1876 switch_rtp_dequeue_dtmf() RTP RECV DTMF 5:2440
2009-07-29 16:10:16 [DEBUG] stest-examp.js:45 console_log() EVENT:dtmf
EXECUTE sofia/internal/+*@199.173.94.88 ([email]sofia/internal/+*@199.173.94.88[/email]):5060 detect_speech(resume)
EXECUTE sofia/internal/+*@199.173.94.88 ([email]sofia/internal/+*@199.173.94.88[/email]):5060 detect_speech(resume)
2009-07-29 16:10:27 [DEBUG] switch_rtp.c:1876 switch_rtp_dequeue_dtmf() RTP RECV DTMF 5:2320
2009-07-29 16:10:27 [DEBUG] stest-examp.js:45 console_log() EVENT:dtmf
Greg |
|
Back to top |
|
|
brian at freeswitch.org Guest
|
Posted: Wed Jul 29, 2009 3:45 pm Post subject: [Freeswitch-users] Stumped on speech recognition |
|
|
SpeechTools.jm is rather simple if you look at ps_pizza.js that uses
it.. you'll get a better feel for how that works. Have you looked at
the pizza demo javascript?
/b
On Jul 29, 2009, at 3:28 PM, Greg Thoen wrote:
Quote: | Still stumped on trying to write a streamlined pocketsphinx speech
recognition. I went through SpeechTools.jm and I think I pulled out
the necessary pieces, but the speech event is not being fired. I get
dtmf events if I push a key, but not speech. I must be missing a
piece, but I have stared at SpeechTools.jm until I can't see
straight. Here is my code:
|
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
gregt at cgicommunicat... Guest
|
Posted: Wed Jul 29, 2009 4:13 pm Post subject: [Freeswitch-users] Stumped on speech recognition |
|
|
Hi. Yes, I have had that running, no problem.
I agree that SpeechTools as a class is easy to use, but I am trying to write a smaller version that I can integrate more with what I am doing; so I am trying to pull out pieces of it. In the example I gave, I am concerned that I can't even get my onInput to see the event. I feel I must be missing some step in my code.
--
Greg Thoen,
Vice President
CGI Communications, Inc.
1-585-427-0020 x260
On Jul 29, 2009, at 4:34 PM, Brian West wrote:
Quote: | SpeechTools.jm is rather simple if you look at ps_pizza.js that uses
it.. you'll get a better feel for how that works. Have you looked at
the pizza demo javascript?
/b
On Jul 29, 2009, at 3:28 PM, Greg Thoen wrote:
Quote: | Still stumped on trying to write a streamlined pocketsphinx speech
recognition. I went through SpeechTools.jm and I think I pulled out
the necessary pieces, but the speech event is not being fired. I get
dtmf events if I push a key, but not speech. I must be missing a
piece, but I have stared at SpeechTools.jm until I can't see
straight. Here is my code:
|
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
|
|
Back to top |
|
|
brian at freeswitch.org Guest
|
Posted: Wed Jul 29, 2009 4:19 pm Post subject: [Freeswitch-users] Stumped on speech recognition |
|
|
http://wiki.freeswitch.org/wiki/Examples_directory_lua_asr_tts
/b
On Jul 29, 2009, at 4:05 PM, Greg Thoen wrote:
Quote: | Hi. Yes, I have had that running, no problem.
I agree that SpeechTools as a class is easy to use, but I am trying to write a smaller version that I can integrate more with what I am doing; so I am trying to pull out pieces of it. In the example I gave, I am concerned that I can't even get my onInput to see the event. I feel I must be missing some step in my code.
--
Greg Thoen,
Vice President
CGI Communications, Inc.
1-585-427-0020 x260
|
|
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|