voice.onStreamingRecognize - GiGAGenie-ServiceSDK/UserGuide GitHub Wiki
gigagenie.voice.setStreamingRecognize ์์ ์ค์ ๋ mode์ ๋ฐ๋ผ ์์ฑ์ธ์ ๊ฒฐ๊ณผ๋ฅผ ์ ๋ฌํด์ฃผ๋ ์ฝ๋ฐฑ API ์ด๋ค. extra.result๊ฐ waittimeout์ผ ๊ฒฝ์ฐ ์คํธ๋ฆฌ๋ฐ์์ฑ์ธ์๋ชจ๋๊ฐ ํด์ ๋๋ค. extra.result๊ฐ endOfSegment ๊ฐ ๋ฐ์ํ๋ฉด ์ดํ ์์ฑ์ธ์๋ ๊ฒฐ๊ณผ๋ ์๋ก์ด text๋ก ๋ถ์ฌ์ ธ์ ์ ๋ฌ๋๋ค.
- gigagenie.voice.onStreamingRecogResult ์ฝ๋ฐฑ ๊ตฌํ
- ์ฝ๋ฐฑ์ function callback(extra) ์ ์์ฑ์ธ์ ๊ฒฐ๊ณผ๊ฐ ์ ๋ฌ๋๋ค. Extra๋ ๋ค์์ผ๋ก ๊ตฌ์ฑ๋ JSON Object ์ด๋ค.
- extra.result : String, Mandatory ๋ก ๋ค์์ ๊ฐ์ ๊ฐ์ง๋ค.
- extra.result=โtextโ : ๋ถ๋ถ์์ฑ์ธ์ ๊ฒฐ๊ณผ
- extra.result=โserverTimeoutโ : ์๋ฒ ํ์์์, text๊ฐ ์ ๊ท๋ก ์ค์ ๋์ด ๋ถ๋ถ์ธ์ ๊ฒฐ๊ณผ๋ก ์ ๋ฌ๋๋ค.
- extra.result=โwaitTimeoutโ : ์์ฑ ์ ๋ ฅ ํ์์์ ๋ฐ์. ์ด๊ฒฝ์ฐ extra.text์๋ timeout์ ๊น์ง ๋ฐ์๋ ์์ฑ์ธ์ ๊ฒฐ๊ณผ๊ฐ ์ ๋ฌ๋๋ค.
- extra.result=โmuteโ : waitthreshold ์ดํ๋ก waittime์ด ๊ฒฝ๊ณผํ์์ ๊ฒฝ์ฐ mode=0์ธ ๊ฒฝ์ฐ ์ ๋ฌ
- extra.result=โnetErrorโ: network ์ฐ๊ฒฐ ์ค๋ฅ
- extra.text : ๋ถ๋ถ ์์ฑ์ธ์๋ ๊ฒฐ๊ณผ
- extra.word : ๋ถ๋ถ ์ธ์๋ ๊ฒฐ๊ณผ ์๋
- extra.result : String, Mandatory ๋ก ๋ค์์ ๊ฐ์ ๊ฐ์ง๋ค.
- ์ฌ์ฉ ์
//gigagenie.voice.setStreamingRecognize
var options={};
options.mode=1;
options.waittimeout=3;
options.waitthreshold=2;
gigagenie.voice.setStreamingRecognize(options,function(result_cd,result_msg,extra){
if(result_cd===200){
console.log("Streaming recognize mode has been set.");
};
});
//gigagenie.voice.onStreamingRecognize
gigagenie.voice.onStreamingRecognize=function(extra){
switch(extra.result){
case 'text':
console.log('Partial Result Received:'+extra.text);
break;
case 'endOfSegment':
console.log('Segment Final Result Received:'+extra.text);
break;
case 'waitTimeout':
console.log('Streaming recognize mod has been unset');
break;
}
}
ํ์ฉ ์์ ๋ (GiGA Genie 2048)์์ ํ์ธ ๊ฐ๋ฅํฉ๋๋ค