How to control voice balance via C# code - c#

I am developing an application in C#, at some point of the program, I'd like to have control of the speaker, more specifically, I'd like to control the voice balance (which speaker - left/right - the voice is coming from). Is there a way to do this?
Thank you,

It depends on how you are using the audio. If you have a two speaker setup, then all you need to do is to create a sound that only plays on the left or right chanel - depending on your requirements.
I have not done this recently, but a few opensource libraries you could have a look at are:
http://windowsmedianet.sourceforge.net/
http://naudio.codeplex.com/
Also check out the multimedia MSDN entry:
http://msdn.microsoft.com/en-us/library/ms712636(VS.85).aspx
Hope this helps.
Cheers.

Related

Monitor microphone changes

Is there any way to monitor microphone changes (plug in and plug out events)? Shouldn't matter if the mic is bluetooth / usb / or plugged directly to sound card.
Application is built with C# but if there isn't any good way to get the events using C# then C++/CLI might be also option.
I found also IMMNotificationClient from WASAPI which should work.
Seems NAudio is not exposing this, but after customization I'm able to use it and get plugin / plugout events. Although it doesn't seem really stable - duplicated events / missing events and etc. Is there any proper implementation example in managed level?
Interface description :: IMMNotificationClient interface
This link may help:
http://blogs.msdn.com/b/coding4fun/archive/2009/10/08/9905168.aspx
The post includes instructions on capturing the microphone level, etc.
Original post. Microphone Input
EDIT: Blog moved here: https://channel9.msdn.com/coding4fun/articles/NET-Voice-Recorder

.NET video play library which allows to change the playback rate?

I am integrating a video player to an existing .NET WinForms application.
I first tried to use "Windows Media Player Control" which is included in Windows SDK,
but I could not change the playback rate.
The following is the code I wrote to change the rate.
if (axWindowsMediaPlayer1.settings.get_isAvailable("Rate"))
{
axWindowsMediaPlayer1.settings.rate = 3.0;
}
The condition in the if statement always returns "false" no matter what video file I use. Does anyone have any idea why I cannot change the rate? It really needs to be available to change the playback rate, so WMP control seems to be a bad choice if it's impossible to do so.
Or, is there any alternative solution which allows me to change the rate? Preferably a .NET based library which does not involve any unmanaged code.
Thanks!
I ended up using DirectShow.NET (http://directshownet.sourceforge.net/) which is an open-source library. It contains a lot of samples, and it has a sample with playback rate control.
IF a commercial library is an option take a look at http://www.visioforge.com/media-player-sdk-net.html
Another commercial option would be Leadtools MultIMedia SDK - see http://www.leadtools.com/sdk/multimedia.htm#+cp_playback
Is the if statement really necessary?
I could set the rate fine without it..
axWindowsMediaPlayer1.settings.rate = 3.0;

Tv card application

I have a gadmei pt228f tv card plugged in to my pc.i need to write a c# application in order to display tv in my application.can someone give me a idea to start with
Take a look at the MediaPortal project. It got support for lots of different TV cards (and it's written in C#)
http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/18_Contribute/4_Development/Subversion_%28SVN%29
Read card driver/API documentation. Design/implement an interface from your app. Start calling stuff.
Rgds,
Martin

Control webcam from C#

I have a Creative Life CAM Optia AF webcam, the software included in the package is able to control the camera in different ways, like set autofocus to auto or manual, and a bunch of gamma and brightness settings.
I'm capturing the feed with the AForge Computer vision library, and it's working great.
But i would like to be able to set the manual focus from inside my application.
Ive been searching for a tutorial, but come up empty handed.
Can i somehow either disassemble the included software, or is there some way to fetch the traffic / instructions being sent to the device?
Thanks in advance.
If the license agreement that comes with the software allows you to disassemble it, you can do so with Reflector (assuming that it's a .NET application).
How to programatically disable the auto-focus of a webcam?
I think i found a way to do this. But i have never written any C++, that is C++ right?
Thanks :)

touch screen programming issue

Suppose I have a touch screen which supports single finger touch, is it very hard to use software based solution (e.g. programming to detect multi-finger touch and movement) to make the touch screen support multi-touch?
Just like I bought a cheap single finger touch cell phone and through programming I make it work as iPhone, Gphone or what so ever cool (supporting multi-touch). :-)
I am using VSTS 2008 + C# + .Net 3.5. I am asking seriously, not joking. Please correct me if I am stupid and on a wrong direction.
It would likely depend upon what sort of information the driver for your device receives. If raw data from the touch panel is available, then you might be able to get some extra information and do some pseudo multi-touch.
My gut feeling, however, is that a single-touch interface will configure itself like a standard USB or PS/2 mouse. This would be done to simplify the driver interface - the manufacturer would be able to expose the hardware via already-established protocols.
If you have a device in mind you could always contact the manufacturer and ask them what sort of additional information they might be able to feed to you.
Touch isn't hugely "there" in .NET 3.5; but the good news is that I'm pretty sure it is much better supported in the 4.0 toolset (WPF 4.0 in particular, see here).
In 3.5, the only time I've personally seen good touch support is when I was using a "surface" device and the surface SDK; note that the surface SDK is not compatible with the regular touch API (although I think they've tried to bring the two together).
Oh, and I suspect you'll need windows 7.

Categories

Resources