Manage two voice modems in C# - c#

I need information how to link two voice modems to each other.
From modem 1 I dial and play a .wav file
then I dial modem 2 and link them to allow them speak.
What do I need to link two modems in C#, is it technically possible?
Thanks.

it is possible, but it will require a fair bit of work.
You need to send commands to the modem to lift, make the call etc. You can do this through AT commands, and the System.IO.Ports.SerialPort class. This bit is fairly standard, and i'm sure you can find an example/lib out there that will handle all this at a higher level than AT commands.
To link the voice part of the modems will depend on the exact modem. Most modems will install an audio component for the OS. If yours do, then what you need to do, is use directX to read/write to the specific audio devices.
What you're building here is a simple voice switch of sorts, and they do require a bit of work. Good luck.

Related

Handle microphone inputs in c #

I searched on Google, but I did not find much information about it. I was wondering if anyone had experience so that they knew a proper way to get data input from a microphone and also know how to play it. What I would like to do is a typical streaming app in C#, which takes audio from the microphone and sends it on the client application. I await advice, thank you.
There're many source codes available if you can use google and bing... If you want to build this application with C# programming language, then you need to know some basics of Network Programming in C#.
If you want build a program like voice chat. You will need grab the audio from the microphone using some technalogies like DirectSound, UDP packets and etc.
If you want build a video streaming application you can use several ways to get video streaming/conferencing with .net easily.
Use of plain Windows Media Encoder components, RTC Clients, voice/SIP, Sockets and etc.
So you have wide choice of managed technologies here. Another thing is Live Meeting at which you had no chance to take good look yet.
For those still interested I found the NAudio library really interesting: https://github.com/naudio/NAudio

How to control my USB port using C# [duplicate]

This question already has answers here:
Power off an USB device in software on Windows
(5 answers)
Closed 9 years ago.
What I want to write is an application that would be able to access my USB port.
To control when to charge my phone and when not to. And perhaps with time I would like to extend the application to control light bulbs, fans and the television in my room.
I want to learn how to work this out rather than just copy some line of codes and paste. I wish for a quick and very simplified tutorial on this, I would be highly grateful (small language please, You all know am still learning :-)).
The exact job I want to achieve is just to make the port send out power when needed. That is it should be switched off and on using codes if possible.
It isn't possible to change the power status of a USB port from User mode code. It's not a .NET limitation, no user application can change the power status of a USB port. Actually, I think that the power state is controlled by the chipset itself and you can't turn it off without using a specialized chipset.
Besides, if your device short-circuited, you could burn your chipset and your motherboard.
The only (safe) solution is to use an external device that will control a relay to turn power on or off for your devices.
There are multiple answers to similar questions, eg Windows- Power off a USB device in Software
A good option is to use an external device like Arduino (or Netduino), .NET Gadgeteer or any number of external boards. Prices and capabilities vary of course.
If you want to build the device yourself, you can find numerous USB relays with a simple Google search
EDIT
Regarding serial ports, there is almost no relation at all between the two port types. Serial ports are not designed to provide power. You can use tricks to use a pin's voltage to power some external device, although this will lead to problems because there is not enough current to power most devices. Burning the chipset is another likely outcome.
A USB port on the other hand, is explicitly designed to provide power through specific wires which can't be controlled normally. This is why you can charge your phone from a desktop's USB port even if the machine has shut down.
EDIT 2: Sleep-and-charge ports
As Ben Voigt noted, not all USB ports allow charging while shutdown.
There are multiple port types that support charging. Charging ports provide more current than plain ports but shut down when the computer is switched off. Sleep-and-charge ports on the other hand can provide power even when the computer is off.

Send/Receive WiFi traffic data

Is it possible to monitor WiFi traffic and send data myself? My goal is to learn how to monitor probe requests, send deauth packets, and other operations similar to AirCrack and the other libraries found on the BackTrack os flavor.
You might have a tough time doing what you want to do in a Windows environment. If you poke around the Aircrack site a bit you'll see that the Windows version is pretty useless in comparison to its Linux counterpart, in large part due to the open source driver availability in Linux and the lack thereof in Windows. You can definitely packet sniff etc. ( http://www.codeproject.com/Articles/12458/SharpPcap-A-Packet-Capture-Framework-for-NET ) but you won't get the robustness that you can get out of a similar application in Linux.
I don't know about sending just random radio signals, but you can certainly monitor the traffic and data. Here is an article which describes how to do it.
AirPcap from Riverbed. USB adapter that can run in monitor mode and has an API for channel switching and more, and you can send Wi-Fi frames if you buy the right adapter. Wireshark has builtin support too. The Alfa cards are a good choice, but only for 'nix

Programmable Control of USB Device

I have used the LPT port before with a VB6 library called inpout32.dll. I'm much more familiar with that but it is not used in modern computers, such as laptops.
I need to control a device with on / off capabilities. This would have been very easy with LPT, but I need to work with USB and C# in this case. There are some USB2LPT cables out there on the market, but I read that they can't be programmed the same way.
Has anyone used those cables before? If yes, how can I work with them. Otherwise what are my alternatives?

Use USB to activate MOSFET/Relay

I am working on a personal project involving sending simple signals from my computer to a circuit via USB. Basically I am using the USB signal as the gate signal for a MOSFET which will in turn activate a relay to turn on/off various AC peripherals. For example if I want to turn on a light bulb for 5 seconds every minute I would be sending a 1 down the first wire for the first 5 seconds of every minute.
This is my problem: I have no idea how to manually send a 0/1 down a specific wire on a USB cable, or even interact with a USB port at all :(
So I guess there are multiple parts to this question, is it possible to interact directly with the bits being sent via a USB port? If so how would I do this? I am familiar with C++ and C#, so I really hope that you can do it in one of those...
Thanks!
edit Hmm so it looks like the USB port actually only has one 5V pin so direct USB interaction wont work. Going to take a look at a parallel adapter and get back on it.
USB is a bad fit for anything that doesn't have a USB interface at the other end of the wire. If you don't want to get into building your own USB device, I'd suggest buying a USB to serial adapter, which gives you two directly-controllable output lines (the flow control lines), or a USB to parallel adapter, which gives you more than 8 lines.
Chris Johnson's answer has a link to instructions for Windows serial port programming. You'll want to look at section 7 -- the SETDTR, CLRDTR, SETRTS, and CLRRTS are your flow control line toggles (for the DTR and RTS lines, respectively).
As far as hardware goes, a "1" (SET) value on a flow control line is +3 to +15 volts on the line, and a "0" is -3 to -15. Actual voltages can vary between devices; measure it to be sure. (EDITED; I got the 1 and 0 mixed up. The control lines use the opposite convention from the data lines.)
Here are Wikipedia pages for voltage characteristics and pinouts.
EDIT: Having done some more research on USB-to-parallel adapters, I don't think they will give the needed level of control. For best results, you'll need a PCI or PCMCIA parallel card, or a parallel port built into the motherboard.
I'm not a Windows programmer, but this library might be useful for controlling the parallel port's lines from Windows.
The easiest thing to do for this application is to use serial port emulation, either with a USB-Serial cable, or with a USB-Serial converter chip (e.g. the FTDI FT232) in your hardware device.
Either way, this allows you to interact with your USB device as you would a serial port (see, e.g. here for how to do this in C++ in Windows)
Much like Chris suggested, you can get a USB slave device from FTDI. $27 at digikey will get you a small board with all the fine wiring already done.
However, for your purposes the bit-banging mode described on page 39 of the datasheet would be much better than the UART mode (UARTs generate pulses at several kilohertz, you want to have the voltage stay at the level you set it to).
Hopefully your MOSFET will turn on with a 3V signal since the FTDI will put out approximately 3.1-3.2V for a high output.
Also, make sure you use the latest drivers from FTDI... a couple years ago they had drivers (WHQL-certified even) that caused frequent BSOD, and I've often found that driver CDs that come with hardware are several years out of date.
I built something very similar to what you are doing (I was running a car window motor from a usb device, used a mossfet H bridge (the HDR1X8 on the diagram) to drive the motor.). You need a USB to I/O device this is what I used (I got a U421, they fit perfectly over the center line of a breadboard, the 401 works well with breadboards too if you don't have a split one.
They give you a dll and you just link in to it with your code. its just as simple as making a call to WriteA and WriteB for writing out to your mosfet device. Be warned logic level lines are not meant to drive current so you will need to hook this up to a transistor if you expect any kind of medium to large current flow. See App1 in the application notes of the menu on the usbmicro site to see the proper way to hook it up.
Use a USB prototype board. It usually comes with a software SDK.
Check out these links from my web site:
1.You can use a usb to serial converter. All you need to know is here
2.You can use programming to access the usb directly but for this one you have to have a driver already installed for you device. Details are here

Categories