Unity-How to play different sounds in different output devices - c#

In the game I'm developing using Unity, I want some of the sounds come out from headphones, others from speakers. After some googling I found one way to implement this is to use NAudio, with which I wrote a c# program, tested it on a PC with two soundcards, and it works. However, I had difficulty using naudio in Unity - it's a Nuget package and I didn't manage to get it installed in Unity(tried asking there but no viable solutions yet:How to use Naudio in Unity).
Could someone help me on how to indicate different output devices for each audio in Unity, or any other workaround to make some sound come out from headphone, others from speakers? Thanks in advance!

Related

How to use LibVLCSharp to stream in game footage from Unity?

I would like to implement an application that is composed by a server application (built with Unity for Windows), where the actual simulation is running, and a client application (built with Unity for Android) to which the rendered game view is streamed to; in other words I want to do remote rendering in Unity and both ends are implemented with Unity.
I have found, among others, LibVLCSharp, which looks quite promising.
My questions are:
- Is it actually possible to achieve the indicated functionality with LibVLCSharp and Unity?
- Does someone know sources where a potentially similar project has been documented?
Unity implementation is currently actively being worked on. It hasn't been open sourced yet and doesn't work quite well for now.
Expect communications on LibVLCSharp if we manage to make it work !
First question: no.
Second question: there can't be any.
"Unity is not officially supported yet, this was a closed beta test. Unity will be supported in LibVLCSharp 4.0" source

Android Game Pad Feasibility

So, I have seen various posts regarding the use of an android phone as a keyboard and as a game pad. I'm actually working on a project that does just that. As you could imagine, I've hit a massive roadblock when it comes to sending the signal from the phone to the PC via USB.
I decided to use unity as the base of this project. I have a functioning GUI and I have some simple code to basically open the port, push through the Serial.write command, and close the port. I also understand that is code will not do me any good without the PC I'm connected to via USB recognizes the phone as a source of input.
That's where I'm stuck.
I've seen posts that involve explanations of how USB works, the different hex codes mapped to keys, ideas of modifying the kernel, third party programs, and third party devices, but nothing concrete on how to move forward in a video game on my PC by simply tapping the screen on my phone. It should be simple right?
So, I'm asking whether or not this project is worth pursuing for the few months I have left to do it or should I consider pivoting to a project that's a little closer to my pay grade(free)?
Although I am not sure if this post is a SO standard question, my train of thought would be to use bluetooth instead of using USB, client-server etc. as they are plagued by problems. While there maybe a certain lag in using bluetooth, programmatically this should be easily achievable. This maybe of interest to you: https://github.com/temach/HIDInterface

How to get WiFi-Signal Strength with Unity engine and C# on Android?

I need the WiFi strength of nearly access points to triangulate the position of the Android device user and show him the part of the building, he is located at the moment. It's for a location based game for new students at my university. There are easy ways with Java or Xamarin and C#, but i couldn't find a way to solve the problem using the Unity engine and C#. It there a way to get it?
I have a complete Android solution in Java from a fellow student and i tried to use AndroidJavaObjects to use that in my program, but without success. It seems to be too complex for that. Are there maybe other ways to use that Java Android code in Unity?
Thanks in advance for the help.

Creating a visualizer Unity3d

I have been trying to find some things online about how to make your own visualizer that responds to sound, But so far I only could find tutorials for on a mac.
I also found some premade visualizer but prefer not to spend 50$ on a asset for it
theasset
I was wondering of somebody could maybe tell me how to basicly code a particle system to respond to sound interactions such as certain frequency's
I've found a nice tutorial here: http://www.41post.com/4776/programming/unity-making-a-simple-audio-visualization.
It is able to get different frequencies from the sounds and do something accordingly. You can try and change the variables of the particle with it.
Another thing I found is a project which analyses the spectrum of sound. You can download it here.
I also found this tutorial which generates a level based on the sound.
These links no longer works
Try them out and let us know what you thought of them and if they helped! Good luck.

Getting sound directly from hardware with C#

Is there a way to get the sound that the sound card is playing directly from the hardware?
NAudio is a nice API for sound programming in C#. I'm only discovered it myself, but it might be able to record the output, though probably not...
http://www.codeplex.com/naudio
some sound cars can select the output sound as mic, if that is acceptable then you could just google how to use the microphone...
The most general way is Total Recorder which has a COM interface.
I presume that this is Windows since you are using C#. Ignore this if you are using mono.
There is no officially supported way to do this in Windows. Some sound cards have a setting in the mixer that will set the wave record input to 'what you hear'. So on those cards, you could just set that setting and then record audio.
edit:
I should add that if your driver doesn't have built in support for recording what it's outputing, then you will need to write or purchase a driver that does. I've heard that TotalRecorder can do this.

Categories

Resources