Search Unity

Use speech recognition on unity with console code

Discussion in 'Scripting' started by PixelFireXY, Mar 16, 2012.

  1. PixelFireXY

    PixelFireXY

    Joined:
    Nov 2, 2011
    Posts:
    56
    Hi, i try to follow the code of this tutorial page
    http://www.blackwasp.co.uk/SpeechRecognition.aspx
    on visual c#(it's an application console, for not importing system.form) and works, i try to import same code in unity pject and unity crashing(i have already import system.speech with framework 3.0 because greater don't work in unity) obviously i have adapted for c# script. Any tip, thank's in advance :D
     
  2. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    It does not appear that System.Speech is available to the Unity Platform. I believe that Unity is .net 2.0 and Speech recognition was made available in 3.0. If of course that is not the case, then you would have to reference it from outside Unity. (possibly make a dll to manage it) then manage it through that to Unity. This would require Unity Pro though.
     
  3. PixelFireXY

    PixelFireXY

    Joined:
    Nov 2, 2011
    Posts:
    56
    what do you mean? can you explain more or less?

    no problem for this, i want buy pro version in about a month :)
     
  4. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    It would involve making a dll in Visual C# or some other compiler to manage all of the interfaces going to System.Speech. Every enum, every control, every... everything would have to be bound to something that Unity can see in a dll. We call them Wrappers. So when you call Speech, your not calling System.Speech, but the speech dll, then in turn it calls .net 3.0 and does something. I am not completely up on the process but it is rather involved.

    This is not the best course if you are a single developer because you will quickly get mired down in the wrapper. However, if you can get it done right then put it up on the Asset store and make some money. ;)
     
  5. PixelFireXY

    PixelFireXY

    Joined:
    Nov 2, 2011
    Posts:
    56
    Thank's man ;) I immediately start to work! :D
     
  6. George Foot

    George Foot

    Joined:
    Feb 22, 2012
    Posts:
    399
    The difficult bit is that you need your DLL to execute using .NET rather than Mono. Very complicated. You might need to start a separate process to do this, and use IPC.
     
  7. PixelFireXY

    PixelFireXY

    Joined:
    Nov 2, 2011
    Posts:
    56
  8. George Foot

    George Foot

    Joined:
    Feb 22, 2012
    Posts:
    399
    Inter-process communication