capture audio data from sound card windows xp - c#

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)

Related

Audio stream from phone to pc via serial port in C#

I'm looking for a way to stream audio from a phone directly to the pc. I'm not talking about music or something but every sound of the phone (voice, ringing etc). Is this possible over an USB cable and the Serial Port of the PC without using third party tools or libraries? I'm currently developing in C#.
No! Do not connect your phone line to the microphone port. The high voltage on the line (60-120V when ringing) may damage your PC.
What you need is a PHONE-to-LINE in adaptor (or sometimes PHONE-TO-MIC adapter) found in electronic stores. Here is an example from AMAZON:
http://www.amazon.com/TRX-20-Direct-Connect-Telephone-ADAPTER/dp/B000KL0XA6/ref=sr_1_1?ie=UTF8&qid=1459033666&sr=8-1&keywords=phone+recording+device (I have no ties or experience with this particular one).
Then, your plug it in to your PC's LINE-IN or MIC (see instructions of the device). From this point on you should be able to record the audio from a call using any sound recording application.
Please keep in mind that PHONE recording may be illegal in some states, if the parties involved are not informed.
If your objective is to detect if a telephone number exists, your method may be intrusive, since it will attempt a call.
In any case, a voice modem could be a better choice, assuming you can find one. Windows used to have a voice modem API & Stack, which should enable you to dial a phone number, wait for the answer or no answer, and then, capture the audio from the remote end. Under most conditions it should detect the ring, busy, or number not available.
The open source project Asterisk (asterisk.org) has "heavy duty machinery" to do this job, albeit it requires specialised programming. There is even an answering machine detection: Asterisk Answering machine detection (AMD) always detects receiver as MACHINE

Is it possible to have our windows Handheld application as a USB receiver?

apologies if the question is quite basic, I am inexperienced in USB programming and I might be missing some conceptual detail here.
For our industrial solution we are supposed to provide communication between our PC wpf application and windows embedded HH 8.1 application. Ideally we would like this to be over USB.
I see a lot of sample code to connect directly to USB devices from host role.
However in our case the Windows Embedded HH device (Panasonic FZ-E1) will have the device role listening. I could not find any way to register to raw data sent from our PC application via USB events. I examined UMDF (user mode driver framework) which has examples about writing drivers for usb devices, yet it seems like it is for device manufacturers and us not being the manufacturer for Panasonic HH we should not/cannot use our own driver and we have to use the WinUSB driver it already has in place.
Windows Embedded 8.1 HH has some USB apis unlike windows phone, yet all the functionality provided in the API seems like connecting to external USB devices with the host role. When we use USBlyzer I see that there is some USB traffic towards the device from the PC so it looks it should be possible for the HH to have the listening device role. What am I missing here, any ideas?
Any help/direction is greatly appreciated.
P.S: I also tried windows connectivity api examining the source code of windows phone power tools yet it seems like the the dlls for addon packages here to handle transfer via agents is not there for newer versions of windows phone anymore.

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.

Possibilities communication beetwen several Windows 8 RT devices (running same app) C# WI-FI

I want to develop an app, which will be running on tablets with Windows 8 (RT). One tablet with this app should be a "master" tablet and this tablet will communicate with other tablets "slave" (running same app). Master tablet should send data to slaves tablets (slave tablet display this received data) and slaves tablets will send data to master. Master collect this data and create some graph etc... I hope you understand. (resume: several same W8 RT app communication with each other)
Can tablets with W8 RT (running same app) communication WI-FI Direct? What´s possibilities are in C#?
Thx for every answer.
Windows 8 includes a capability to help you establish connections between copies of your app running on different devices. That capability is called PeerFinder.
Currently PeerFinder can find other devices using NFC (tap the two devices together) or using WiFi if both devices support Wifi Direct. After the initial handshake, both devices communicate using sockets.
The Proximity Sample shows basic use of PeerFinder:
http://code.msdn.microsoft.com/windowsapps/Proximity-Sample-88129731
PixPresenter is a sample app that uses PeerFinder and exchanges images between devices:
http://code.msdn.microsoft.com/windowsapps/PixPresenter-Code-sharing-39ed631f
PeerFinder.SupportedDiscoveryTypes tells you what methods are currently available for discovering other devices:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.proximity.peerfinder.supporteddiscoverytypes
Hope that helps.
Dev support, design support and more awesome goodness on the way: http://bit.ly/winappsupport
If it's local network, you can use raw TCP communications and use UDP discovery to identify the master.
If it's a more distributed setup like the internet or separated network areas, I'd recommend you have a look at Microsoft Azure Queue Storage services explained here. This will allow a distributed and redundant master-slave model.
As a complement, if anytime you need to emulate NFC you can use a specific sample driver :
Windows 8.1 : How to use Near-Field Proximity API without NFC hardware
Hope it helps.
Stéphanie
Also, here you will find a WinRT lib that you can use to help you tranfer data/files between Windows 8 peers running the same application, using Wifi-Direct :
http://blogs.msdn.com/b/stephe/archive/2013/12/11/win8-1-transfering-a-file-between-2-peers-using-wifi-direct-and-proximity-api.aspx
Best regards

How to use computer's Bluetooth to send Wallpapers to any cellphone, in C#?

I'd like to know if it is possible how to do it, because my client asked me if the program I'm developing could also send wallpapers to nearby cellphones(my program will be in a place with many people passing by, so it would be good to have the bluetooth feature).
Thanks!
it can send pictures as files, users then may set them as wallpapers.
Unless the phone and the computer support bluetooth and are connected, you cannot. You can send the files to mobiles over bluetooth. 32feet provides a nice library to perform bluetooh related operations. Try that.
Hope it helps.
To do this you would need to
Make sure each user's device is paired to your bluetooth "sever"
Create the ability to auto connect and send the file.
On your phone's application, receive the image file and set the phone background - this will be different for each type of phone's OS. I would assume you are aiming towards Window Mobile Devices, since you are using c#.
The first step i see as being the difficult step as each phone much "register" the bluetooth of the server to be paired with it.

Categories

Resources