Windows Sound mixer/settings can set the microphone to play over the speakers. I'm looking for a way to do that through C#. I'm assuming there is a DLL reference or .NET call that might be able to.
Everything I've been finding invariably goes back to streaming, which I don't want to do. Unless that's whats actually happening under the hood when changing the audio settings in windows.
If it helps, I'm using C# 3.5 (Unity App) and running on Windows 10 latest.
Thanks!
You can do this with Core Audio APIs link
For implementation you can refer
https://blog.sverrirs.com/2016/02/windows-coreaudio-api-in-c.html
Related
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
My goal is to mix 2 audio files that is one voice and one background music. For mixing I am using NAudio.
The problem is I am getting following exception while reading mp3 file using NAudio's Mp3FileReader.
DllImport cannot be used on user-defined methods
I am using NAudio in Windows Phone 8.1 Silverlight app project. I am not sure if NAudio is useable on WP Silverlight app if its useable then please help by providing a code example or suggest any other library or custom implementation to mix 2 audio files.
No, I'm afraid NAudio is not usable on Silverlight, as it makes lots of calls into Windows APIs which you can't do in Silverlight. You can take a look at the NAudio NLayer project which offers fully managed MP3 decoding. You could use that in conjunction with some of the more generic helper classes in NAudio like the MixingSampleProvider to perform the mixing you require. Of course the next issue would be what you want to do with that mixed audio. Silverlight does have a way of streaming user generated audio using the MediaElement but NAudio does not provide support for this directly.
[DllImport] requires a substantial chunk of code in the CLR, nothing very subtle about the pinvoke marshaller. That's a problem on a phone, it runs a special version of the CLR named .NETCore. Probably better known today as the codebase that spun-off the CoreCLR open source project. Keeping it small required unsubtle choices, pinvoke fell on the floor.
So no, you'll have no use at all for NAudio. You'll have to dip into the built-in support for audio. The relevant oversight MSDN page is this one. This blog post is relevant.
As you can tell, XAudio2 is your ticket with direct support for mixing. There is a learning curve of course, the language is probably the first obstacle given the question tags. Get started with this sample to get the basics.
Maybe you should consider taking the step to upgrade from WP8.1 Silverlight (WPS) project to WP8.1 (WinRT) one so that you have better access to audio APIs...
...or directly to a UWP/Win10 app (if you don't plan to release immediately to phones). If you choose that path, you could try maybe a free preview tool that converts WPS to UWP, just released from Microsoft and Mobilize.NET - https://blogs.windows.com/buildingapps/2015/09/17/initial-preview-of-silverlight-bridge-to-uwp/
I have searched the XNA Media.VideoPlayer library. It has no direct method for setting a time, but MediaPlayer has a Position to set playing position.
Is there any indirect way to set the time?
In classic Microsoft style, this simple, yet necessity feature is not available:
Thank you for the suggestion and the spirited commentary. While we understand that this capability is important to you, we are not planning to add this capability to the Windows Phone developer platform. - Cliff Simpkins (Sr Product Manager, Windows Developer)
If you're trying to do this for PC, you might be able to use this workaround.
If you're going for Xbox or Windows Phone... Sorry!
Having searched high and low for native c# hook to webcam, I found 5 basic ways to interact with the camera.
Video for Windows (VFW)
DirectX
avicap32.dll
WIA
3rd party tools
My requirement is to take a photo. The application will be used on some legacy windows XP and Vista machines, but going forward Windows 7 and greater will be required. So what might the best approach be with the broad install base? Just reading WIA looked like the way to go but looks like some changes were made so it works a little different now (I don't know for sure). I understand that some people have done combos.
Might need to crop photo, but that is really about it.
For school visitor monitoring.
I think the best thing is to use the WIA. I know a third party toolkit that could help you doing your requirements which is leadtools. You can check this Tutorial
I would always try to pick up something already on the web and tweak it to my own needs... some open source project or an example where the mainly portion of my app is already made.
on Codeplex you can find a nice library to work with webcams and it's simply called
WebCam Library for WinForm and WPF with C# and VB.NET
Give that a try, maybe you can even help the project, by contributing your own findings, and everyone is a winner... isn't Open Source a great idea?!
Is it possible to use the NAudio on a silverlight application?
I just can't add the dll to my project... I'd like to build a little audio mixer.
I already searched on google but i can't find a way to do that...
someone has some hints for it???
NAudio uses tons of interop into Win32 functions that would be completely impossible to run in Silverlight.
UPDATE:
If you are looking for an MP3 player for Silverlight you may check out the Silverlight Audio Player.