Sound Input

Hi guys,

one of my students is looking to make a 3D game, but part of it involves using mic input to shout to make things happen, does unity have any kind of provision for this? hes currently planning it in director, which would make the sound part possible, but everything else incredibly laborious and difficult, i know, I used to do it myself before I discovered unity!

Thanks

Will Goldstone

Right now it is perfectly possible by creating a plugin to do this, but there isn’t anything built in.

What kind of sound input are you looking for? Just a “current audio level” scalar input or something more elaborate?

-Jon

No exactly that, we’d be looking to try and detect volume of sound going into a microphone, and literally, as you say, convert the volume variable’s value (try saying that 3 times!), into a force or velocity to apply to something.

see this post

http://forum.unity3d.com/viewtopic.php?t=3676

for the game it will be used in…

I have no idea how one would even start to consider writing a plugin!.. any tips?

The Plugins with a couple of examples are explained in the documentation. To write a simple plugin you’d have to write some C/C++ code that uses some native sound input API (depends whether you’re targeting Mac or Windows or both) and just returns the sound level to Unity.

I don’t have any tips besides to check out the documentation on how to create a plugin.

http://unity3d.com/Documentation/Manual/Plugins.html

You’ll need some C / C++ / Objective-C experience to make one, or take a lot of time to learn it. :-/

-Jon

sadly i dont have either the time or experience… damn… thank you tho Jon you’ve been really helpful, cheers