I'm looking at integrating voice chat into my Unity game, and have made a custom C# library to handle this for me. It uses DirectX to read voice data from the mic and then transfers it over UDP.
However, every time I try to use any DirectX functions in my custom DLL, (and then compile it and update the DLL in my Assets/ folder) Unity gives me the following error:
Internal compiler error. See the console log for more information. output was: Unhandled Exception: System.TypeLoadException: Could not load type 'VoiceComm.VoiceCommHandler' from assembly 'VoiceComm, Version=188.8.131.52, Culture=neutral, PublicKeyToken=null'.
If I don't link in Microsoft.DirectX.dll my custom DLL imports fine and I can call functions on it no problem.
Did you ever solve this? I am trying the same thing but with DirectInput and getting the same problem.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
2 People are following this question.
Import DirectSound DLL
[c#] DirectSound in Unity
Why can't I build Web Player in Unity while I have no problems with building standalone versions?
Can't load type from DLL.
How to set unity for finding the c# dll?