Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Japunga · Dec 08, 2011 at 12:46 PM · plugin.netlibraryspeechpro-only

Speech Recognition Unity Pro

Hey guys,

I'm wanting to implement speech recognition into my unity game using the .NET library System.Speech. I understand that this libary isn't (or at least doesn't seem to be) supported in the current version of Unity (even when the reference is added). My question is, if i was to purchase Unity Pro which allows me to add native plug-ins (.dll files), would I be able to add the System.Speech.dll file to my Unity Pro application??

Has anyone attempted this previously??

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by CHPedersen · Dec 08, 2011 at 01:24 PM

As I understand plugins, they give you access to good ol' P/Invoke. P/Invoke is when you call native code in a DLL-file by using the "extern"-keyword to declare in your managed code that the implementation of a function is to be found in a native library and not in the same assembly. This enables the runtime to load the functions in the DLL file you link to, and to mix memory access to both the managed heap and whatever the DLL uses (by way of marshalling, I believe).

Unfortunately for you, that's not what you want to do. Plugins and P/Invoke is strictly for native code, but just because something is a DLL file does not make it native code. System.Speech is not native code, it's a class library written in .Net. You can't call its functions or instantiate its objects with plugins, unfortunately. System.Speech looks like a relatively new addition to the .Net framework, so chances are the horribly outdated Mono version used by Unity (Unity Technologies: update it already!) doesn't cover that particular namespace.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Bunny83 · Dec 08, 2011 at 02:41 PM

Usually you can add any pure .NET / Mono dll to your project as an asset. Just place the dll somewhere in you asset folder (not in the plugins folder) and you should be able to use it, as long as it's own dependencies are available.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image CHPedersen · Dec 08, 2011 at 02:48 PM 0
Share

I think he has tried this already, and come up with the conclusion that it wasn't supported, likely because it was built with .Net components not included in Unity's current version of $$anonymous$$ono.

avatar image Japunga · Dec 09, 2011 at 12:26 AM 0
Share

I've tried adding the library to the "references" folder in the compiler, however i haven't tried adding it in my asset folder. Do you think this might make a difference??

avatar image Bunny83 · Dec 09, 2011 at 03:09 AM 0
Share

Yes, it would make a difference ;) The references of your solution / project aren't used by Unity. Unity calls the compiler itself and it only can use assemblies that are directly supported / known to Unity and those that belong to your project which includes all assemblies Unity creates itself and all assemblies that are within the asset folder.

However, like already said, if your assembly belongs to something that isn't supported by Unity's mono version it won't work.

avatar image rumela.saraswati · Mar 13, 2016 at 01:35 PM 0
Share

Thank you so much ... this worked ! I have been trying since yesterday to work this out.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Getting SSH.NET to work in Unity 1 Answer

Do Native Mobile Plugins Require Pro? 1 Answer

Unity + AR = .exe 1 Answer

Anyway to workaround .NET 4.0 framework outside/inside Unity? 1 Answer

How to create a library from my C# project that runs on Android 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges