⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tmsgvoc 1.1.html

📁 Voice Modem 使用源码
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html>

<head>
<title>TMSgVoc 1.1 Description and Help</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">

<meta name="Microsoft Border" content="none"></head>

<body>
<font SIZE="2">

<p align="center"></font><font size="4" color="#FF8040"><strong>TMsgVoc 1.1<br>
Description and Help</strong></font><font SIZE="2"></p>

<p><strong>DESCRIPTION<br>
</strong>It is a complete interface for Voice Modems, like &quot;US Robotics
&nbsp; Sportster 33.6 Voice&quot; and similar. It makes easy to use your voice modem as a <a href="#Playing voice">player</a> or <a href="#Recording voice">recorder</a> or both, like
an answering machine or an automatic voice caller, detecting <a href="#Detecting RING">RING</a>
and <a href="#Detecting DTMF tones">DTMF tones</a> at the same time. The use of TMsgVoc is
simple, however some experience in modems and telephone lines is suggested. The operations
of&nbsp; TMsgVoc are ruled by going end exit different status. For a list of them see <a href="#GetStatus">GetStatus</a>.</p>

<p><a name="Playing voice"><b>Playing voice</b><br>
</a>TMsgVoc takes care of all the phases of dialing, connecting, playing, stopping playing
and disconnecting.&nbsp; All the phases of working of TMsgVoc can be displayed calling the
method <a href="#GetStatus"><u>GetStatus</u></a> or <a href="#GetStatusString">GetStatusString</a>
and the dialogue with the modem can be seen reading the string <a href="#ModemDialog"><u>ModemDialog</u></a>,
at any moment. The following table lists the sequence of possible operations.</p>

<table border="1" width="96%">
  <tr>
    <td width="33%" align="center"><strong>Sequence</strong></td>
    <td width="21%" align="center"><strong>Method</strong></td>
    <td width="32%" align="center"><strong>String sent to the modem</strong></td>
    <td width="59%" align="center"><strong>Example of string</strong></td>
    <td width="59%" align="center"><strong>Event raised in case of success</strong></td>
  </tr>
  <tr>
    <td width="33%">Initialization</td>
    <td width="21%"><a href="#GoIn">GoInit</a></td>
    <td width="32%"><a href="#InitString">InitString</a></td>
    <td width="59%">&amp;F M1 L2 S40=2 #CLS=8 #VSM=128,8000</td>
    <td width="59%"><a href="#OnInit">OnInit</a></td>
  </tr>
  <tr>
    <td width="33%" rowspan="2">Dialing and connecting in Voice Command Mode</td>
    <td width="21%" rowspan="2"><a href="#GoDialConn">GoDialConn</a></td>
    <td width="32%"><a href="#DialNum">DialNum</a></td>
    <td width="59%">0024 621 4934 9945</td>
    <td width="59%">&nbsp;</td>
  </tr>
  <tr>
    <td width="32%"><a href="#ConnString">ConnString</a></td>
    <td width="59%">H1 A</td>
    <td width="59%"><a href="#OnConn">OnConn</a></td>
  </tr>
  <tr>
    <td width="33%">TX mode</td>
    <td width="21%"><a href="#GoTX">GoTX</a></td>
    <td width="32%">AT#VTX</td>
    <td width="59%">&nbsp;</td>
    <td width="59%"><a href="#OnTX">OnTX</a></td>
  </tr>
  <tr>
    <td width="33%">Playing</td>
    <td width="21%"><a href="#Play">Play</a></td>
    <td width="32%">all the bytes of 'filename'</td>
    <td width="59%">&nbsp;</td>
    <td width="59%"><a href="#OnPlayed">OnPlayed</a> (at the end of playing)</td>
  </tr>
  <tr>
    <td width="33%">End of TX mode</td>
    <td width="21%"><a href="#GoEndTX">GoEndTX</a></td>
    <td width="32%">&lt;DEL&gt;&lt;ETX&gt;</td>
    <td width="59%">&nbsp;</td>
    <td width="59%"><a href="#OnEndTX">OnEndTX</a></td>
  </tr>
  <tr>
    <td width="33%">Disconnetting</td>
    <td width="21%"><a href="#GoDisc">GoDisc</a></td>
    <td width="32%"><a href="#DiscString">DiscString</a></td>
    <td width="59%">H0</td>
    <td width="59%">&nbsp;</td>
  </tr>
</table>

<p><a name="Recording voice"><b>Recording voice<br>
</b></a>You can also use TMsgVoc to record, setting <a href="#RecFile"><u>RecFile</u></a>
with the name of the file where to store the recorded voice. Recording starts with the
method <u><a href="#GoRX">GoRX</a> </u>and stops with the method <a href="#GoEndRX"><u>GoEndRX</u></a>.
All the phases of working of TMsgVoc can be displayed calling the method <a href="#GetStatus">GetStatus</a> or <a href="#GetStatusString">GetStatusString</a>, the
dialogue with the modem can be seen reading the string <a href="#ModemDialog"><u>ModemDialog</u></a>,
at any moment. The following table lists the sequence of possible operations.</p>

<table border="1" width="96%">
  <tr>
    <td width="33%" align="center"><strong>Sequence</strong></td>
    <td width="21%" align="center"><strong>Method</strong></td>
    <td width="32%" align="center"><strong>String sent to the modem</strong></td>
    <td width="59%" align="center"><strong>Example of string</strong></td>
    <td width="59%" align="center"><strong>Event raised in case of success</strong></td>
  </tr>
  <tr>
    <td width="33%">Initialization</td>
    <td width="21%"><a href="#GoIn">GoInit</a></td>
    <td width="32%"><a href="#InitString">InitString</a></td>
    <td width="59%">&amp;F M1 L2 S40=2 #CLS=8 #VSM=128,8000</td>
    <td width="59%"><a href="#OnInit">OnInit</a></td>
  </tr>
  <tr>
    <td width="33%" rowspan="2">Dialing and connecting in Voice Command Mode</td>
    <td width="21%" rowspan="2"><a href="#GoDialConn">GoDialConn</a></td>
    <td width="32%"><a href="#DialNum">DialNum</a></td>
    <td width="59%">0024 621 4934 9945</td>
    <td width="59%">&nbsp;</td>
  </tr>
  <tr>
    <td width="32%"><a href="#ConnString">ConnString</a></td>
    <td width="59%">H1 A</td>
    <td width="59%"><a href="#OnConn">OnConn</a></td>
  </tr>
  <tr>
    <td width="33%">RX mode and recording to <a href="#RecFile">RecFile</a></td>
    <td width="21%"><a href="#GoRX">GoRX</a></td>
    <td width="32%">AT#VRX</td>
    <td width="59%">&nbsp;</td>
    <td width="59%"><a href="#OnRX">OnRX</a></td>
  </tr>
  <tr>
    <td width="33%">End of RX mode</td>
    <td width="21%"><a href="#GoEndRX">GoEndRX</a></td>
    <td width="32%">&lt;DEL&gt;</td>
    <td width="59%">&nbsp;</td>
    <td width="59%"><a href="#OnEndRX">OnEndRX</a></td>
  </tr>
  <tr>
    <td width="33%">Disconnetting</td>
    <td width="21%"><a href="#GoDisc">GoDisc</a></td>
    <td width="32%"><a href="#DiscString">DiscString</a></td>
    <td width="59%">H0</td>
    <td width="59%">&nbsp;</td>
  </tr>
</table>

<p><a name="Detecting DTMF tones"><strong>Detecting DTMF tones<br>
</strong></a>During any phase of operations of TMsgVoc, excluding the status stDisc and
stInit, DTMF tones are received and recognized by TMsgVoc. In this case <a href="#OnDTMF">OnDTMF</a>
is raised.</p>

<p><a name="Detecting RING"><strong>Detecting RING<br>
</strong></a>During any phase of operations of TMsgVoc, included the status stDisc, RING
is detected and, in this case, <a href="#OnRING">OnRING</a> is raised.</p>
</font>

<p><font SIZE="2"><a name="Setting the serial port"><strong>Setting the serial port<br>
</strong></a>The serial port is handled directly by the component, so that only <a href="#ComPortNumber">ComPortNumber</a> and <a href="#ComPortBaudRate">ComPortBaudRate</a>
must be set. </font></p>

<p><font SIZE="2"><a name="Setting the modem"><strong>Setting the modem<br>
</strong></a>It is not very easy to get information about the right settings of modems in
general, regarding playing and recording voice. Be sure nothing of the kind can be found
in the operating or technical manual, and very little in the &quot;at commands&quot;
manual. &nbsp; Check also my <a href="useful_links.htm">Useful links</a><br>
The default settings found in the component TMsgVoc are correct to perform operations
using a &quot;US Robotics Sportster Voice 33600&quot; with the protocol GSM 6.10 USR
(AT#VSM=128,8000). The following tabel lists the possible settings for US Robotics
Sportster Voice 33.6:</font></p>
<div align="center"><center>

<table border="1" width="60%" height="91" style="font-family: serif">
  <tr>
    <font SIZE="2"><td width="19%" align="center" height="30"></font><font size="3">AT#VSM=</font></td>
    <td width="48%" height="30"><p align="center">Compression method</td>
    <td width="51%" height="30"><p align="center"><a href="#ComPortBaudRate">ComPortBaudRate</a>
    to be set at</td>
  </tr>
  <tr>
    <font SIZE="2"><td width="19%" align="center" height="6">128,8000</font></td>
    <td width="48%" align="center" height="6">GSM USR</td>
    <td width="51%" align="center" height="6">br19200</td>
  </tr>
  <tr>
    <font SIZE="2"><td width="19%" align="center" height="15">129,8000</font></td>
    <td width="48%" align="center" height="15">G721 ADPCM USR</td>
    <td width="51%" align="center" height="15">br38400</td>
  </tr>
  <tr>
    <font SIZE="2"><td width="19%" align="center" height="16">130,8000</font></td>
    <td width="48%" align="center" height="16">IMA ADPCM USR</td>
    <td width="51%" align="center" height="16">br38400</td>
  </tr>
</table>
</center></div><b><font size="3">

<p><a target="_self" href="#Properties"><font COLOR="#ff00ff"><u>Properties</u></font></a><big>
</big><a href="#Methods"><font COLOR="#ff00ff"><u>Methods</u></font></a><big>&nbsp;</big>&nbsp;<a href="#Events"><u>Events</u></a></font><font size="4"></p>

<p></font><font size="3"><a name="Properties">Properties</a></p>
</font></b><font size="2">

<p><strong><a name="ComPortBaudRate">ComPortBaudRate</a><br>
</strong>The baud rate used to set the com port, to send/receive data to/from the modem.<br>
<strong>TComPortBaudRate = ( br110, br300, br600, br1200, br2400, br4800,br9600, br14400,
br19200, br38400, br56000,br57600, br115200 );<br>
property ComPortBaudRate: TComPortBaudRate;<br>
</strong>It should be set at the right speed to be sure that the voice be digitalized at
the right speed during both recording and playing. Check your modem manual or, better, ask
the manufacturer of modem. For example, US Robotics Sportster Voice operates correctly
using protocol GSM (#VSM=128,8000) only if you set <br>
ComPortBaudRate := br19200;</p>
<b><font size="3">

<p></font></b><a name="ComPortNumber"><strong>ComPortNumber<br>
</strong></a>It must be set with the com port where the modem is connected. TMsgVoc
handles the serial port and the voice modem by itself. In Windows '95 or NT4.0 there is no
need to set any modem or to load its driver.<br>
<strong>TComPortNumber = ( pnCOM1, pnCOM2, pnCOM3, pnCOM4 );<br>
property ComPortNumber: TComPortNumber;<br>
</strong>For example ComPortNumber := pnCOM2; </p>
<b>

<p><a name="ConnString">ConnString<br>
</a></b>The string to set the modem to connect in Voice mode.<br>
<strong>property ConnString : string;<br>
</strong>For example, for USR Sportster Voice: #CLS=8 #VSM=129,8000 #VLS=2 sets the modem
in voice (#CLS=8), it plays in G721 format (#VSM=129,8000), it sends voice to the
headphone connected to the modem (#VLS=2)</p>

<p><strong><a name="DialNum">DialNum</a><br>
</strong>It is the phone number to be dialed before playing the vocal message. <br>
<strong>property DialNum : string;<br>
</strong>Write here the phone number to be dialed, for example 4044931. It will be used in
the &quot;at command&quot; atd4044931; so some modifiers can be inserted, like p0,4044931
to wait for the external line of a telephone exchange, dialing with pulses, or similar.</p>

<p><b><a name="DiscString">DiscString</a><br>
</b>The string to stop Voice mode and to return On hook<br>
<strong>property DiscString : string;<br>
</strong>For all the modems I know, it will be: H0</p>

<p><strong><a name="InitString">InitString</a><br>
</strong>The string of at command to initialize the modem.<br>
<strong>property InitString : string;<br>
</strong>Set InitString with the AT commands to set your modem before beginning dialing
and the other operations. For example, for USR Sportster Voice:&nbsp; <br>
&amp;F1 M1 L3 S40=2 #CLS=8 #VSM=129,8000 #VLS=2 <br>
resets the modem parameters (&amp;F), turn on the loudspeaker (M1), pop up the volume
(L3), disables count of dialling (S40=2), sets the modem in voice (#CLS=8), it plays in
G721 format (#VSM=129,8000), it sends voice to the headphone connected to the modem
(#VLS=2).<br>
See alse <a href="#ConnString">ConnString</a> and <a href="#GoConn">GoConn</a></p>

<p><strong><a name="LastingTime">LastingTime</a><br>
</strong>It is the maximum time of activity, in milliseconds, for the complete cycle off
hook-dialing-playing-on hook<br>
<strong>property LastingTime : Integer;<br>
</strong>Set this property to play a long recording or to be sure that, after LastingTime
msec the connection will be interrupted. Even if <u>NumRep </u>is set to play a very long
recording, after LastingTime msec, playing will be interrupted all the same.</p>

<p><strong><a name="PollingTime">PollingTime</a><br>
</strong>Internal polling time of TMsgVoc <br>
<strong>property PollingTime:Integer;<br>
</strong>This time is set to 200 msecs, by default. Don't modify it; try other values only
if you are modifying TMsgVoc itself. Try shorter values 200-100 msec if your modem is
playing the voice with unwanted pauses.</p>
<b>

<p><a name="RecFile">RecFile</a><br>
</b>The name of the file to be overwritten, or created if it doesn't exist, to store the
recorded voice.<br>
<strong>property RecFile : string;<br>
</strong>The format of the file will depend on the format set in the modem with the
command #VSM=.....<br>
The extension of RecFile is not automatic.<br>
See also <a href="#RecConn"><u>RecConn</u></a></p>

<p><b><strong><a name="Active">Active</a><br>
</strong></b>Read Only. If TMsgVoc is working, it will be True, otherwise it will be False<br>
<b><strong>property Active : Boolean;<br>
</strong></b>It can be used to see if TMsgVoc can receive commands. If Active is True,
many properties can't be modified.</p>
<b>

<p><a name="Methods"><strong>METHODS</strong></a></font><font size="3"></p>
</b>

<p></font><font size="2"><b><b><a name="GoInit">GoInit</a><br>
</b></b>TMsgVoc will initialize the modem. <br>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -