voice.onStreamingRecognize - GiGAGenie-ServiceSDK/UserGuide GitHub Wiki

์ŠคํŠธ๋ฆฌ๋ฐ์Œ์„ฑ์ธ์‹ ๊ฒฐ๊ณผ ์ˆ˜์‹ 

gigagenie.voice.onStreamingRecognize

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 : ๋ถ€๋ถ„ ์ธ์‹๋œ ๊ฒฐ๊ณผ ์›Œ๋“œ
  • ์‚ฌ์šฉ ์˜ˆ

//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)์—์„œ ํ™•์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค

โš ๏ธ **GitHub.com Fallback** โš ๏ธ