{"id":24,"date":"2022-01-27T22:44:22","date_gmt":"2022-01-27T22:44:22","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/tapiaang\/?p=24"},"modified":"2022-01-27T22:44:22","modified_gmt":"2022-01-27T22:44:22","slug":"blog-post-4-more-on-speech-recognition-in-unity","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/tapiaang\/2022\/01\/27\/blog-post-4-more-on-speech-recognition-in-unity\/","title":{"rendered":"Blog Post 4 &#8211; More on Speech Recognition in Unity"},"content":{"rendered":"\n<pre class=\"wp-block-verse\">we're in week 2 of putting together our vr simulation. it's becoming more manageable as time goes on. i tried wit.ai and dialogflow for speech recognition before i settled with microsoft's speech sdk for unity. <\/pre>\n\n\n\n<pre class=\"wp-block-verse\">the basic idea is that i need to be able to do things in-game based on the user saying a correct phrase. the first step was to get voice recognition into a unity project. <\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"698\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5159\/files\/2022\/01\/2022-01-20-22_03_53-testVoice-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.3.24f1-_DX11_-1-1024x698.png\" alt=\"\" class=\"wp-image-25\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5159\/files\/2022\/01\/2022-01-20-22_03_53-testVoice-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.3.24f1-_DX11_-1-1024x698.png 1024w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5159\/files\/2022\/01\/2022-01-20-22_03_53-testVoice-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.3.24f1-_DX11_-1-300x205.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5159\/files\/2022\/01\/2022-01-20-22_03_53-testVoice-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.3.24f1-_DX11_-1-768x524.png 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5159\/files\/2022\/01\/2022-01-20-22_03_53-testVoice-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.3.24f1-_DX11_-1.png 1201w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-verse\">with the speech sdk i was finally able to use a script that would start when i pressed a button, listen to what i say through my microphone, and output it to a text object in the game. i got this working with a physics-based button as well as with a floating button that you would see in most vr games. <\/pre>\n\n\n\n<pre class=\"wp-block-verse\">the next step was to see if i could modify connect this script to another, and to modify something when a specific phrase is spoken. i also changed the language that would be listened for. <\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"475\" height=\"347\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5159\/files\/2022\/01\/2022-01-26-20_48_59-from-microphone-HelloWorld-Android-Unity-2020.3.24f1-_DX11_.png\" alt=\"\" class=\"wp-image-26\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5159\/files\/2022\/01\/2022-01-26-20_48_59-from-microphone-HelloWorld-Android-Unity-2020.3.24f1-_DX11_.png 475w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5159\/files\/2022\/01\/2022-01-26-20_48_59-from-microphone-HelloWorld-Android-Unity-2020.3.24f1-_DX11_-300x219.png 300w\" sizes=\"auto, (max-width: 475px) 85vw, 475px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-verse\">i added \"yes\" to the message returned by the speech sdk when i spoke the phrase \"tambien necesito lechuga y pan.\" then i had it print through another script on another object in the scene, which is what i assume will need to happen in a game like this anytime we interact with another npc. so i'm getting closer to what i need. <\/pre>\n\n\n\n<pre class=\"wp-block-verse\">my next step is to try this out on placeholders for npcs that will be in our game and see if i can get more complex things to happen. eventually this will mean that once a correct phrase is spoken the scene will continue. or if an incorrect phrase is spoken, the npc and ui will indicate that the player needs to try again. <\/pre>\n","protected":false},"excerpt":{"rendered":"<p>we&#8217;re in week 2 of putting together our vr simulation. it&#8217;s becoming more manageable as time goes on. i tried wit.ai and dialogflow for speech recognition before i settled with microsoft&#8217;s speech sdk for unity. the basic idea is that i need to be able to do things in-game based on the user saying a &hellip; <a href=\"https:\/\/blogs.oregonstate.edu\/tapiaang\/2022\/01\/27\/blog-post-4-more-on-speech-recognition-in-unity\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Blog Post 4 &#8211; More on Speech Recognition in Unity&#8221;<\/span><\/a><\/p>\n","protected":false},"author":12001,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/tapiaang\/wp-json\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/tapiaang\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/tapiaang\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/tapiaang\/wp-json\/wp\/v2\/users\/12001"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/tapiaang\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":1,"href":"https:\/\/blogs.oregonstate.edu\/tapiaang\/wp-json\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":27,"href":"https:\/\/blogs.oregonstate.edu\/tapiaang\/wp-json\/wp\/v2\/posts\/24\/revisions\/27"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/tapiaang\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/tapiaang\/wp-json\/wp\/v2\/categories?post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/tapiaang\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}