How do I use a modem to send an audio message?
<Jean-Pierre Drolet sinternaATtr.cgocable.ca>
(Sep 2000)
To send an audio message by phone you need a voice modem. Unfortunately some of the commands required differ from one manufacturer to other. Thus a VI done for a specific modem might not work for another type.
To have a modem independant interface you could also use the Windows Telephony API (TAPI) on Windows systems. Unfortunately this would invlolve delving into DLL calls from within LabVIEW (not for the faint hearted). Indeed, some of the system calls required to get this to work are quite cryptic. However at least on Windows, the telephone line of a voice modem is configured as a Sound I/O device and LabVIEW recognizes it. Unfortunately, it does not seem to be possible to use Sound VIs to send/receive audio messages from LabVIEW to the telephone line (it would be GREAT!).
Below are the commands required for a Rockwell Semiconductor Systems series of modems. The instructions were pulled from the "AT Commands for RCV56ACx, RCV336ACx, RCV288ACx, and RCV144ACx Modems" Reference manual. Hopefully they will guide you through the requirements for your specific modem.
All the send commands should be preceded by "AT". The commands are shown as send (SND) and receive (RCV) pairs.
SND: #CLS=8 Configure the modem for Voice Mode (still ADPCM).
RCV: OK The modem agrees, and is now set up for voice.
SND: #BDR=16 The DTE knows that compression requires a 38,400 bps speed, so it forces this as the new speed.
RCV: OK This OK message is sent at 2400 bps, but the modem then switches to 38,400 bps.
SND: #VLS=0 This ensures that the telephone line is selected.
RCV: OK The modem agrees.
SND: #VRA=45 The DTE allows 4.5 seconds for ringback to stop before assuming that the modem thinks that the remote has answered.
RCV: OK The modem agrees with the DTE's assumption.
SND: DT6807 The DTE makes a telephone call, and the modem dials and goes through call progress. BUSY or NO DIALTONE can be detected, but in this example, the modem gets ringback.
VCON This message is sent 4.5 seconds after the third
ringback cadence is detected by the modem. The modem is in effect assuming that the remote telephone was answered on the third ring because no fourth ringback was detected before the #VRA time-out. The modem enters Online Voice Command Mode, and DTMF and answer tone detection is enabled. (Note that during this period, the modem might have detected answer tone from a data modem. In this case, the appropriate <DLE> shielded code has to be sent prompting the DTE to pursue a data handshake.)
SND: #VTX The DTE has a message to send.
RCV: CONNECT The modem says: "send it."
SND: <Data> The DTE sends the message: "Hi Dave. Your mother called."
RCV: <DLE><ETX> Procedure complete.
VCON DTMF still active.
SND: H The DTE has completed its forwarding task.
<Data> is the audio data stream of the message to send. 1,2,4 and 8 bits "compression" (read resolution) are supported. This example is for 4 bits compression , if the message data has 8 bit resolution, you packed the 4 MSbits of every two bytes in a single byte and send it. <DLE> (ASCII 8) is the escape code for shielded codes; you have to send it twice when encountered in the data stream. You end data stream with <DLE><STX>. 4 bits compression requires at least DTE (computer) connection at 38400 bps, 8 bits requires 115000 bps.
posted on 2005-06-24 01:32 LabVIEW开发者 阅读(493) 评论(0) 编辑 收藏 举报