How to Add Voice Recognition to Your Game - Unity Tutorial

Поделиться
HTML-код
  • Опубликовано: 26 сен 2018
  • Help to support the channel if you are feeling super kind: / dapperdino
    Join our Discord: / discord
    docs.microsoft.com/en-us/wind...
    In this video I show you how you can use your own voice to call functions for your game in Unity.
    -----------------------------------------------------------------------------------------------------------
    If you liked the video then please respond with a like and a subscribe to show your support for the channel and I'll repay you by creating more tutorials to teach you the wonder that is Unity :D

Комментарии • 223

  • @babitadeboer6338
    @babitadeboer6338 3 года назад +8

    Thank you so much for this. Simple and to the point! Didn't ever seen something this easy to set up

  • @EtherPump
    @EtherPump 5 лет назад +20

    Usually people who make tutorials take so much time to explain everything. This video has the good amount of explaining without it dragging on. Top notch

  • @onurbonceoglu
    @onurbonceoglu 3 года назад +1

    Great tutorial. I like that you try to explain things rather than saying "just write this". Thank you!

    • @blakerobertson9989
      @blakerobertson9989 3 года назад +1

      yes this is the only totorial i like becouse u dont have the code already written

  • @bigdummyhead2162
    @bigdummyhead2162 3 года назад +1

    Really loved the idea of the Dictionary didnt even think of that myself

  • @micmicmw
    @micmicmw 3 года назад

    Great tutorial thank you so much I have been looking for a video or web page tutorial on voice input.

  • @romeogolf7761
    @romeogolf7761 4 года назад

    Thanks for this. Really appreciate you sharing this knowledge.

  • @murtaklah4233
    @murtaklah4233 5 лет назад +4

    Thanks, great tutorial!

  • @Zenzyde
    @Zenzyde 5 лет назад +7

    So that’s how you can do voice recognition...so simple! Nice one dude! :D

    • @DapperDinoCodingTutorials
      @DapperDinoCodingTutorials  5 лет назад +1

      Thanks :D The documentation is in the description in case you would like to read up on it some more :)

  • @NotASpyReally
    @NotASpyReally 2 года назад +1

    what?? I would have never thought this would be so easy!!!
    Thank you so much for this tutorial!
    now I will be able to recreate Deltarune Chapter 2 berdly fight and tell Noelle to do "snowgrave" with my own voice

  • @tired_jet
    @tired_jet 4 года назад +2

    thank you so much! i'm from Mexico and this worked perfectly with words in spanish!! you are AMAZING! thanks again!

    • @pablomonfortgames6723
      @pablomonfortgames6723 3 года назад

      how you did, did you have any issue on the way? i want to archieve that thing too in spanish. but my microphone dosnt seems to work, i dont get it yet still cant understand why is not working for me :(

  • @Sorcerer0
    @Sorcerer0 4 года назад +7

    I play 10 hours with it and I' loved it

  • @bgowriel
    @bgowriel Год назад

    Cheers, friend! Great tutorial ❤

  • @Mars.TN_
    @Mars.TN_ 2 года назад

    Amazing video thank you so much. Don't even need it in my school project just wanted to know how it worked but goddamn you gave me a great idea thank you for the great video!

  • @danielverman
    @danielverman 3 года назад

    Thank you! Really useful!

  • @jimmyxrose
    @jimmyxrose 2 года назад

    great tutorial, thanks very much!

  • @FullStackIndie
    @FullStackIndie 3 года назад

    Dude!!! thank you so much this is so awesome!!! much appreciated man. God bless!

  • @rohitpardhi3924
    @rohitpardhi3924 5 лет назад

    Simple as that, thank you very much

  • @oscarurselli5579
    @oscarurselli5579 4 года назад

    Very useful thank you !!

  • @suleymanyalcinkaya5705
    @suleymanyalcinkaya5705 Год назад

    It works very good, Thank you !!

  • @wisdomcube7789
    @wisdomcube7789 5 лет назад +7

    This guy is a life saver....thumbs up~~

  • @rmt3589
    @rmt3589 Год назад +1

    This is amazing! Just what I need, on the engine I'm learning.
    Any chance we can get a part two, with custom player inputs. I'm thinking something like how Nintendogs allows custom trick names. Any anything about recognizing player's headmotions or handmovements? (For reference, I'm interested in making a VR game)

  • @waymanharris1284
    @waymanharris1284 4 года назад

    Great Job!

  • @thiliniwish19
    @thiliniwish19 4 года назад

    cool!!! totally works!

  • @HaykAmirbekyanTKD
    @HaykAmirbekyanTKD 4 года назад

    thanks for the tut! Subscribed. How does Unity know which microphone to use when there are multiple Mics connected to the computer including VR/AR mics?

  • @DocHollidayGames
    @DocHollidayGames 4 года назад +4

    Is there a way to incorporate this method with speech which requires parsing of commands from variable components, like “rotate left 45 degrees”

  • @flightsimguy3897
    @flightsimguy3897 Год назад

    Thank you verry much

  • @shrikantbidgar7132
    @shrikantbidgar7132 5 лет назад +1

    Bro now I am your Die_heart faaaaaaan
    god really bless you
    mindfully ,heartfully thankyou

  • @barmyeye7708
    @barmyeye7708 2 года назад

    Thanks!

  • @weiguopeng5881
    @weiguopeng5881 3 года назад +1

    Thanks for your sharing!
    A Question: If I want to take some action when the KeywordRcognizer fails to recognize keywords(When I say a word not in the keyword lists), what should I do? It seems that there is only OnPhraseRecognized event and no something like RecongitionRejected. I don't want to use a timer.

  • @jt9564
    @jt9564 3 года назад

    This is awesome, could I for example, say start game or next or back, ant it will function?

  • @abed83a
    @abed83a 3 года назад

    Nice video with clear explanation. Is it possible to Open URL by voice, instead of clicking them?

  • @xinyueyang1962
    @xinyueyang1962 5 лет назад

    Thank you

  • @heinzfourie8030
    @heinzfourie8030 5 лет назад

    Awesome man thank you for making this, do you know if the recognition is based on interim or final results? if it acts on final result, then you wouldn't happen to know how to check on the interim results? you'd probably get the cube to move twice as fast with interim results :-) let me know, thanks.

  • @vedantkadam2147
    @vedantkadam2147 3 года назад +1

    what do we have to do if we want to implement the samething for a android..i am trying to make a vr game just for some fun and i dont really have the oculus vr but just a normal cardbord so i want to use such commands in their

  • @radhamadhava8838
    @radhamadhava8838 5 лет назад

    I'd like to make a mantra/prayer counter. How would I link a phrase to a counter on screen? And when it reaches a certain amount, how to trigger an event (like, Your prayers have been heard!).

  • @christine2651
    @christine2651 5 лет назад

    It works great, but can I call the voice recognision from a function and that it doesnt work otherwise.

  • @vinx312
    @vinx312 Год назад

    bro thanks

  • @arrone7
    @arrone7 2 года назад +2

    @DapperDino
    I agree with some of the others, for mobile would be good. I've been looking for this for mobile and VR (not sure if SteamVR can connect to the Oculus’ android SDK or would just use Windows?). There are tutorials that use GCP, Azure or AWS for STT but as shown, but using the built in STT makes a lot more sense is obviously faster. It would be amazing to learn about using the mobile version of this, though I don't imagine it being as easy?
    P.S. Please keep up the tutorials! Already found a dozen or so that are going to be useful and I'll probably end up watching through whole playlists! Cheers.

    • @Miablosumimasen
      @Miablosumimasen 2 года назад +1

      Any update on finding something like this on mobile?

  • @TheJCEguy
    @TheJCEguy 5 лет назад

    how do i trigger animations + moving it in different directions

  • @leoportopassos
    @leoportopassos 3 года назад +1

    Hello!
    Thank you very much for the video.
    Do you know how I should publish my game (was maked based on your tutorial) on web?
    I try to export my game to WebGL, but I receive some errors about .
    Do you know how I solve this problem?

  • @mejklyn3075
    @mejklyn3075 4 года назад

    sir how to control the user to go in and out from 360 videos using voice recognition?

  • @michaelhu105
    @michaelhu105 2 года назад

    hi, Dapper Dino. Thank you very much. support so great video. i have a question:when voice is end, how i know the voice is end. i want do something when voice is end. eg. when i speak some words, and after two seconds, can auto recognition the audio clip. do you know how to implement it? thank you very much!

  • @emiliatrevino3094
    @emiliatrevino3094 2 года назад

    What if I want to add a fecture where an object or person in the game mimics your voice and say it over again with other words as well?

  • @T0xIcNigHtMarE
    @T0xIcNigHtMarE 5 лет назад +2

    Love the video, Still waiting on that inventory dragging system video tho :/

    • @DapperDinoCodingTutorials
      @DapperDinoCodingTutorials  5 лет назад +2

      Since you seem to be an active commenter, I'll try my best to get that video done tomorrow (or today depending on time zones xD)

    • @T0xIcNigHtMarE
      @T0xIcNigHtMarE 5 лет назад +2

      Dapper Dino - Coding Tutorials woooooooooooot

  • @random_precision_software
    @random_precision_software 5 лет назад

    Wow just came across your channel..good stuff..

  • @pablomonfortgames6723
    @pablomonfortgames6723 3 года назад

    this tutorial seems to be nice, but im having problem its like it dosnt reconize any sound of my microphone and i can listen to my microphone its not the best one but im wondering what can be :( any hint? thanks.

  • @hggamesstudio8581
    @hggamesstudio8581 Год назад

    Nice

  • @benhogan86
    @benhogan86 3 года назад +1

    does anyone know how to give unity access to mic on Mac OS

  • @TheRuiPires
    @TheRuiPires 5 лет назад +44

    Hello! Great video.
    I have a request: can you make one video on voice recognition for android microphone? I can't seem to find any way of making it work. I'm still a noob at this. Thank you so much.

    • @Zaedric
      @Zaedric 4 года назад +4

      I would appreciate this as well !

    • @GeniusHipHop
      @GeniusHipHop 3 года назад +2

      Yes, that would be nice

    • @eliasmoll7604
      @eliasmoll7604 2 года назад

      did someone figure out a way to do it?

    • @TheRuiPires
      @TheRuiPires 2 года назад

      @@eliasmoll7604 responding to increase the chances of being noticed.
      Haven't found a way till now. I gave up a long time ago though.

    • @ChristianSquare
      @ChristianSquare Год назад

      @@TheRuiPires till now?

  • @istandcat5882
    @istandcat5882 3 года назад +2

    Any idea why I can't turn keywordrecogniser into a green word (sorry for the non-technical terms)

  • @ZYJGO
    @ZYJGO Год назад

    Hi Dapper, thanks for this super helpful tutorial, however when I use this in a multiplayer game, it shows that there is already a keyword recognizer for xxx, do you know how can I fix this problem?

  • @shaunseah757
    @shaunseah757 Год назад

    Can this recognize strings of speech like “I need backup” or something

  • @salvadoralvidrez731
    @salvadoralvidrez731 3 года назад

    Great tutorial. One question: how would you suggest to trigger another action (like playing an audiosource) instead of moving?

    • @pablomonfortgames6723
      @pablomonfortgames6723 3 года назад +1

      thats really easy bro , i can teach you if want, im just trying to make this work its seems my microphone is too bad that dont even activate the event of speech recognition :( , but once i archieve this i will create a super nice hologramic robot AI with 3d head gestures and audio play triggers :)

    • @salvadoralvidrez731
      @salvadoralvidrez731 3 года назад

      @@pablomonfortgames6723 Thanks, I'd appreciate that

  • @beFrah
    @beFrah 4 года назад +1

    Hi I in my script cant recognize "private KeywordRecognizer keywordRecognizer;" HELP!

  • @MrJuliusHibert
    @MrJuliusHibert Год назад

    Sweet... it works and serves well. However, how can I catch everything I said and not just the keyword?

  • @justinwhite2725
    @justinwhite2725 3 года назад

    I'm surprised you didn't need to import anything external and that it all just works.

  • @pedropablolopezlopez2520
    @pedropablolopezlopez2520 2 года назад

    How can I use this for a Android mobile app? I guess this example only works on Windows PC.

  • @superarcherg5320
    @superarcherg5320 3 года назад

    its not working for me on mac the code is exactly the same how would i get this to work?

  • @hoshimiyaeki
    @hoshimiyaeki 2 года назад

    I came across an error when the app is not in focus, the speech recognition does not work at all. I need speech recognition to run in the background for an app

  • @topclips39
    @topclips39 3 года назад

    Thx

  • @youssefmhammedi4951
    @youssefmhammedi4951 4 года назад

    Can you explain it with the android SDK plz

  • @mugeerciyes1144
    @mugeerciyes1144 5 лет назад +2

    excellent video ^^ can you also explain implementation of voice recognition in google speech recognition api on Unity ?

    • @DapperDinoCodingTutorials
      @DapperDinoCodingTutorials  5 лет назад

      Could you further explain what you mean by using "google" speech recognition in Unity?

    • @BiggstheCat
      @BiggstheCat 5 лет назад

      FrostWeepGames has a Google Machine Learning Kit on the asset store. Not free but worth the money from the small bit I've messed with it. There's individual assets as well if you don't want the full kit.
      You'll need to connect it with the cloud I'm pretty sure and make a Google developers account. There's a bit in the initial setup but it's relatively easy to make use of after.
      Great tutorial as an offline solution Dapper. I'll have to see if there's a similar Android setup.

  • @framegames14
    @framegames14 2 года назад +2

    I've done the script but I'm getting this error: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
    Does anyone know how I can fix this?

    • @coutyl28
      @coutyl28 2 года назад +2

      Add using System;

  • @eliasmoll7604
    @eliasmoll7604 2 года назад

    did anyone figure out a way to use something similar in android builds? Thanks

  • @T0xIcNigHtMarE
    @T0xIcNigHtMarE 5 лет назад

    Also I'm trying to add a 3rd to first person camera/movement change to my project, I can't really use CineMachine cuz I'm not 100% on how it works or if it is something that I should use but basically in the main camera script it has a float called distance(distance from the camera to the target/tracker) and I'm trying to create a script that will move the target/tracker to a specified vector3 so it'll appear more in front of the player rather than where the tracker was which was inside of the player. I'm having trouble though figuring out how to do this.. If distance is

    • @Blu-ray
      @Blu-ray 4 года назад

      i know this is a year old but just create an empty, put the cube and the camera in the empty and attach the script to the empty

  • @asra-studios
    @asra-studios Год назад

    This is amazing but I want same function for Android, can we do it on android also?

  • @harshparihar9857
    @harshparihar9857 2 года назад

    can we switch scene by voice command?

  • @aaronpak6130
    @aaronpak6130 4 года назад +1

    wait how do i enable it on a mac?

  • @genius1485
    @genius1485 5 лет назад

    work it in any language

  • @boxitor9355
    @boxitor9355 3 года назад

    how do i recognize any word that has been said?

  • @baranidharan3561
    @baranidharan3561 7 месяцев назад

    that capabilities section is not showing in my unity what can i do

  • @I_am_thing
    @I_am_thing Год назад

    I am getting a namespace error at

  • @rahulpatil3333
    @rahulpatil3333 5 лет назад

    hello sir uwp hai nahi build setting main

  • @infinitiSscripts
    @infinitiSscripts 3 года назад

    Hi umm can there be voice Recognition for Mac cause I am a Mac user?

  • @Litefeather_
    @Litefeather_ Год назад

    Is ther any event that happens if it fails to recognize the word?

  • @NtaGot
    @NtaGot 3 года назад

    how can i do the same thing with an android device???

  • @alicewithalex
    @alicewithalex 5 лет назад +1

    Nice but wait for shaders)

  • @die3Brocken
    @die3Brocken 4 месяца назад

    in the editor it works fine for me. But in Standalone/Build the recognition doesnt seem to work:( Nothing happens... Any ideas?

  • @faiz7180
    @faiz7180 4 года назад

    Is there a way to make the enemy attack you when you make a sound? Which means you have to stay silent not to get caught by the enemy. I wonder if that type of voice recognition is possible. (Just like the game Escape The Ayuwoki)

    • @nnNothing
      @nnNothing Год назад

      just read how loudness your microphone

  • @slightlygruff
    @slightlygruff 5 лет назад +10

    can you get it to recognize single phonemes? Like "a" or "g"?

  • @NavdeepSindhuvit
    @NavdeepSindhuvit Год назад

    This is not working on Mac please give solution

  • @user-fs4tl7wv9r
    @user-fs4tl7wv9r Год назад

    If Action is not found (cs0246) just put using System;

  • @user-yy8vx9vt8h
    @user-yy8vx9vt8h 5 лет назад +1

    good , is that work for android?

  • @divyar4938
    @divyar4938 4 года назад

    @Dapper dino ..thanks for the great video !
    can you please share linkfor apk or source code

  • @Mad5pirit
    @Mad5pirit 3 года назад

    its time to make a john constantine game. thank you

  • @Mr.Epsilion
    @Mr.Epsilion Год назад

    what about the android or IOS? how actually force work of them?

  • @viditkhanna3721
    @viditkhanna3721 5 лет назад +1

    Great Work. Will this work for android?

  • @TrongNguyen-yc1lx
    @TrongNguyen-yc1lx 5 лет назад

    Hello. I using mac, Unity 2018.3.9f1, I not found set microphone, I followed the tutorial and the result was an error:
    Attempted to access a missing method. " keywordRecognizer = new KeywordRecognizer(actions.Keys.ToArray());". Please!

    • @essylo
      @essylo 5 лет назад +1

      Windows only, as it uses cortana

    • @TrongNguyen-yc1lx
      @TrongNguyen-yc1lx 5 лет назад

      @@essylo Thank u. How to use identified voice when build app Android or IOS from Unity in macOS

  • @amadra826
    @amadra826 4 года назад +1

    How do i implement it with.. Let's say rpg mechanics like spells?
    Do you have any tip on how to speed it up for faster activation

    • @overdose5805
      @overdose5805 3 года назад

      maybe try on awake instead of start

    • @blakerobertson9989
      @blakerobertson9989 3 года назад +1

      @@overdose5805 it helps a little

    • @Dezomm
      @Dezomm 3 года назад

      @@overdose5805 that would make no difference

  • @lki246811
    @lki246811 4 года назад

    How about android & iOS?

  • @justlaz1444
    @justlaz1444 3 года назад +1

    error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)

    • @justlaz1444
      @justlaz1444 3 года назад +1

      changed Action to System.Action and now everything works.
      private Dictionary actions = new Dictionary();

    • @morawel3368
      @morawel3368 3 года назад

      @@justlaz1444 you are big man bro

  • @josephallancruz4867
    @josephallancruz4867 3 года назад

    is this working on android device?

  • @honefone
    @honefone 5 лет назад

    hmm got this error:
    UnityException: Speech recognition is not supported on this machine.
    UnityEngine.Windows.Speech.KeywordRecognizer..ctor (System.String[] keywords, UnityEngine.Windows.Speech.ConfidenceLevel minimumConfidence) (at C:/buildslave/unity/build/Runtime/Export/Windows/Speech.cs:221)
    UnityEngine.Windows.Speech.KeywordRecognizer..ctor (System.String[] keywords) (at C:/buildslave/unity/build/Runtime/Export/Windows/Speech.cs:201)
    Test_Dictionary.Start () (at Assets/Test_Dictionary.cs:17)
    win 7 problem? i tried lots of suggestions on the web

    • @thedude7854
      @thedude7854 5 лет назад +1

      Yeah, this only works with Windows 10.

  • @BabyGlass
    @BabyGlass 3 года назад

    is there offline voice recognition?

  • @dotan19586
    @dotan19586 5 лет назад

    it doesn't work for me without keywordRecognizer.Start(); in the Start function

  • @brovideolol3488
    @brovideolol3488 4 года назад

    I can yell for ever! I made a A B or C option but doesn't do anything... help?

  • @nelsongomez8547
    @nelsongomez8547 2 года назад

    Hello friend, I hope you're very well.
    Excellent your video.
    Is possible use ML-agents in this project?
    If you answer is "yes", Could give me some resource, video... As help, PLEASE..
    I need information for i begin

  • @flightsimguy3897
    @flightsimguy3897 Год назад

    How get it in dutch

  • @anqiwang3648
    @anqiwang3648 4 года назад

    hi, thanks a lot for the video, when I run it, the unity just showed" The type or name "keywordRecognizer" could not be found" do you know any reasons about this problem?

    • @jahrazzjahrazz8858
      @jahrazzjahrazz8858 4 года назад +1

      your script probably has: private keywordRecognizer keywordRecognizer;
      but should be: private KeywordRecognizer keywordRecognizer;

    • @blakerobertson9989
      @blakerobertson9989 3 года назад

      using

  • @Avinash_Lincoln
    @Avinash_Lincoln 2 месяца назад

    will this work for WebGL?