how to set volume of remote machine to the maximum level [duplicate] - c#

Windows 7 has per-application volume controls that let you mute applications individually. How can I mute and unmute an application from a console app?

You'll want to use the IAudioSessionManager2 COM interface. Have a look at Vista Core Audio API Master Volume Control that wraps some of the new Core Audio APIs. The console project therein enumerates active audio sessions and lets you tweak volume and mute status of an active audio session.

Related

Send commands to external Windows Media Player application using C#

I want to control the external running Windows Media Player application using C#. For example, I want to send the play or pause command to the process of the running exe-file "%ProgramFiles(x86)%\Windows Media Player\wmplayer.exe", which was started by the user and is playing a playlist. How can this be done instead of embedding a windows media player control?

c# windows phone 8 app, change system volume

I use WASAPI (Windows Audio Session API) in my windows phone app to play some single tone.
How i can change system volume of device, so when user click on "play" button, even if volume = 0 (muted) signal will be heard.
i tried to use ISimpleAudioVolume interface(http://msdn.microsoft.com/en-us/library/windows/desktop/dd316531(v=vs.85).aspx) but it change volume level of an audio session but if device in mute signal is not heard.
please help.

Windows Phone 8 app wakup on bluetooth connection?

Is it possible in a Windows Phone 8 app that isn't active to detect Bluetooth connections and react to them?
I want to build a app the does some stuff as soon a the phone connects to the Bluetooth device. I.e. get in range of the device.
I'm realizing that this might be more than one question.
a. is it possible to detect bluetooth connection when the app isn't active.
b. is it possible to "popup" the app if it detects a connection?
All connections of any kind are suspended when the application is in background mode. Your application cannot really respond to any events at all.
Unfortunately, this is the limitation of the sandboxed app model which lives in isolation from the operating system. When in background, it is suspended and no sensors nor connections live.

Restrict access to audio device under Windows XP-8 to specific application/user

I have written an c# 4.0 application that analyses the microphone input and records DTMF tones that represent credit card numbers entered by our clients. This all works well, but since we are working under PCI Compliance (see www.pcisecuritystandards.org), we don't want to allow the logged in user (call centre staff) to listen or even record the microphone input so that they then can parse the credit card numbers on their own with a 3rd party app or their phones. So the question I have is:
How can I restrict the microphone input to a specific application so
that it can't be heard or recorded somewhere else?
If there is no solution to this, the 2nd question arises:
How can I restrict the microphone input to a specific user so that it
can't be heard or recorded somewhere else (I could run the software
as a Windows service under specific user credentials)?
Kind regards,
JB
The main way to restrict access to device is setting of Security Descriptor on the device. So granting of the permission for specific user group is the way in which you should go.
The exact implementation for Windows XP could be different from later versions of Windows. Windows 8 have new possibilities too. Audio Mixer APIs can be used in Windows XP. Starting with Vista Windows Multimedia Device (MMDevice) API can be used. MMDevice API's implementation of the property store. You can use IPropertyStore::SetValue and IPropertyStore::Commit to change properties. Unified Device Property Model are introduced starting with Windows Vista. There are different Windows API which uses internally SetupAPI to access to devices and to set it's properties (see here). I think that you should set PKEY_Device_SecuritySDS property to secure device. One can use old APIs like SetupDiSetDeviceRegistryProperty and SetupDiSetClassRegistryProperty to set the properties on Windows XP (see here).
If I start on my computer devmgmt.msc and examine default property of microphone device then I can see Security Descriptor
What you need is to change it so that only specific user groups (or users) access it.
There are PKEY_Device_SecuritySDS and PKEY_Device_Security properties which can be change by SetupDiSetDeviceProperty and SPDRP_SECURITY_SDS or SPDRP_SECURITY (see here). Usage of SDS parameters (PKEY_Device_SecuritySDS or SPDRP_SECURITY_SDS) could be easier because there use readable Security Descriptor Definition Language (SDDL).
After you change security descriptor on the device you need use SetupDiSetClassInstallParams and SetupDiCallClassInstaller with DIF_PROPERTYCHANGE and DICS_PROPCHANGE to reset the device. You can find the code example in the source code of devcon utility on WinDDK. Alternatively you can use CM_Disable_DevNode and CM_Enable_DevNode to restart it with new properties.
You should be able to do it with the Core Audio API. For each playback device and capture device in the system, you can control whether the device can be used in exclusive mode.
One drawback - there is no support for Core Audio API under Windows XP.
I think the solution to your problem is to write a KS Filter
Create a Kernel Streaming filter that is able to decode the DTMF on demand of your application and send the decoded data to your application. When the filter is in DTMF decoding mode, it just outputs silence to the rest of the filter stack.
If an USB audio device is used, you could also write a GFX Filter instead, which can be configured on a per-user-base. But this only seems to work for 32-bit operating systems. WinDDK has a sample called gfxswap.xp.
You can use ASIO audio drivers in your application.
ASIO is a technology developed by Steinberg to provide low latency audio input and output, and as a side effect, requiring a device using an ASIO driver completely restricts the device use to the process that required it, in addition to multiple other advantages that may be irrelevant to your needs.
It is available for every soundcard thanks to the ASIO4ALL project, so compatibility won't be an issue as long as you provide it with your application
For more informations, check out the wikipedia article about ASIO here, or pick up the SDK here ( you will need to register a Steinberg Developer account to proceed )
Will it be helpful if you can control (MUTE) the VOLUME of the sound device and set it back to it's former state once you are done? You can look at this link for ideas. Good luck.

capture audio data from sound card windows xp

My requirement is to capture whatever (audio)is playing on client machine and send it to server as live streaming. On windows 7 i am banging my head on WASAPI Loopback for this purpose. But that is not supported in windows XP. Do anyone has idea how it can be done in Windows Xp?
You can use DirectX.
Take look at this:
capturing sound and more with Managed DirectX (MDX) 1.1
Windows XP does not provide built-in support for loopback capture. Your can only do it if your soundcard has a "what you hear" option that can be selected for recording. If not, then you would need to use a specially created sound card driver that allows you to intercept the audio being sent to it, and passes it on to your real soundcard. There are a few commercial products that do this (such as Virtual Audio Cable)

Categories

Resources