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

📄 tmsgvoc 1.1.html

📁 一个可以用语音modem录音放音的Delphi控件源码
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<strong>procedure GoInit;<br>
</strong>InitString is sent to the modem and, after the OK from the modem, TMsgVoc enters
the status stInit.</p>

<p><b><b><a name="GoDialConn">GoDialConn</a><br>
</b></b>TMsgVoc&nbsp; will dial and force the modem to go into the 'Command Voice mode'<b><b><br>
</b></b><strong>procedure GoDialConn;<br>
</strong>TMsgVoc will send DialString to the modem and, in case of success, it will send
ConnString as well.</p>

<p><b><b><a name="GoConn">GoConn</a><br>
</b></b>TMsgVoc&nbsp; will force the modem to go into the 'Command Voice mode', without
dialing<br>
<strong>procedure GoDialConn;<br>
</strong>TMsgVoc will send ConnString to the modem and, in case of success, it will enter
in the status stConn.</p>

<p><b><b><a name="GoTX">GoTX</a><br>
</b></b>TMsgVoc&nbsp; will force the modem to go into the 'TX mode', from where voice can
be played.<br>
<strong>procedure GoTX;<br>
</strong>TMsgVoc will send AT#VTX to the modem and, in case of success, it will enter in
the status stTX.</p>

<p><b><b><a name="GoEndTX">GoEndTX</a><br>
</b></b>TMsgVoc&nbsp; will force the modem to exit the 'TX mode'<br>
<strong>procedure GoEndTX;<br>
</strong>TMsgVoc will send &lt;DLE&gt; &lt; ETX&gt; to the modem and&nbsp; it will go back
to the stConn status.</p>

<p><b><b><a name="GoRX">GoRX</a><br>
</b></b>TMsgVoc&nbsp; will force the modem to go into the 'RX mode' and it will begin to
record into the RecFile.<br>
<strong>procedure GoRX;<br>
</strong>TMsgVoc will send AT#VRX to the modem, it will enter in the status stRX and it
will begin to record into the RecFile. If RecFile doesn't exist, it will be created,
otherwise it will be overwritten.</p>

<p><b><b><a name="GoEndRX">GoEndRX</a><br>
</b></b>TMsgVoc&nbsp; will force the modem to exit the 'RX mode'<br>
<strong>procedure GoEndRX;<br>
</strong>TMsgVoc will send &lt;DLE&gt; to the modem and&nbsp; it will go back to the
stConn status.</p>

<p><b><a name="GoDisc"><strong>GoDisc</strong></a><br>
</b>It stops playing or recording and sets the modem on hook. <br>
<b><strong>procedure GoDisc;</strong><br>
</b>It sends <a href="#VocDisc">VocDisc</a> to the modem and, after that, it sends ATH0,
setting the modem off hook. It can be given whenever it could be useful.<br>
See Also: <a href="#GetStatus">GetStatus</a></p>

<p><strong><b><b><a name="Play">Play</a><br>
</b></b></strong>It plays the file, whose name is filename, NumRep times.<br>
<b><strong>procedure Play(filename : string; <a name="NumRep">NumRep</a> : Integer) ;<br>
</strong></b>if TMsgVoc is in TX status, it will play filename, NumRep times. Be sure to
set filename to a proper file because no control or automatic setting will take place
inside TMsgVoc. For example, if you set it using the name of a text file, it will be sent
to the modem all the same and an odd noise will come out from the modem. Besides, take
care the file is in the correct format, like GSM, ADPCM and so on. To see the formats that
your modem can play and record give the command AT#VSM=? Play can be called asynchronously
or driven by the event OnConn When playing is finished, the event OnPlayed will be raised.<br>
See also OnConn</p>

<p><b><strong><a name="GetStatus">GetStatus</a><br>
</strong></b>It gives the status of playing or recording. <br>
<strong>function GetStatus : TMsgVocStatus;<br>
</strong>During any activity of TMsgVoc, it returns a string corresponding to the
following status.<br>
</p>

<p><b><strong><a name="GetStatusString">GetStatusString</a><br>
</strong></b>It gives the status of playing or recording. <br>
<strong>function GetStatusString : string;<br>
</strong>During any activity of TMsgVoc, it returns a string corresponding to the
following status.<br>
</p>

<table border="1" width="78%" height="309">
  <tr>
    <td width="26%" align="center" height="15"><strong>Status</strong></td>
    <td width="48%" align="center" height="15"><strong>Description</strong></td>
    <td width="45%" align="center" height="15"><strong>Modem status</strong></td>
    <td width="41%" align="center" height="15"><strong>Notes</strong></td>
  </tr>
  <tr>
    <td width="26%" align="left" height="15"><p align="center">stGoDisc</td>
    <td width="48%" align="center" height="15">DiscString, usually ATH0, is sent to the modem</td>
    <td width="45%" align="center" height="15"></td>
    <td width="41%" align="center" height="15"></td>
  </tr>
  <tr>
    <td width="26%" align="left" height="12"><p align="center">stWaitDisc</td>
    <td width="48%" align="center" height="12">waiting for OK</td>
    <td width="45%" align="center" height="12"></td>
    <td width="41%" align="center" height="12"></td>
  </tr>
  <tr>
    <td width="26%" height="15"><p align="center">stDisc</td>
    <td width="48%" height="15"></td>
    <td width="45%" height="15">On hook</td>
    <td width="41%" height="15"></td>
  </tr>
  <tr>
    <td width="26%" height="30"><p align="center">stGoInit</td>
    <td width="48%" height="30">InitString is sent to the modem</td>
    <td width="45%" height="30">On hook</td>
    <td width="41%" height="30"></td>
  </tr>
  <tr>
    <td width="26%" height="30" align="center">stWaitInit</td>
    <td width="48%" height="30">waiting for OK from the modem</td>
    <td width="45%" height="30">On hook</td>
    <td width="41%" height="30"></td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stInit</td>
    <td width="48%" height="15">OK arrived</td>
    <td width="45%" height="15">On hook - initialized</td>
    <td width="41%" height="15">GoConn, GoDial or GoDisc can be given</td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stGoDial</td>
    <td width="48%" height="15">DialString is sent to the modem</td>
    <td width="45%" height="15">On hook - dialing</td>
    <td width="41%" height="15"></td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stWaitDial</td>
    <td width="48%" height="15">waiting for OK from the modem</td>
    <td width="45%" height="15">On hook - dialing</td>
    <td width="41%" height="15"></td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stDial</td>
    <td width="48%" height="15">OK arrived</td>
    <td width="45%" height="15">Off hook</td>
    <td width="41%" height="15">it goes automatically to stGoConn</td>
  </tr>
  <tr>
    <td width="26%" height="30" align="center">stGoConn</td>
    <td width="48%" height="30">ConnString is sent to the modem</td>
    <td width="45%" height="30">On hook</td>
    <td width="41%" height="30"></td>
  </tr>
  <tr>
    <td width="26%" height="30" align="center">stWaitConn</td>
    <td width="48%" height="30">waiting for VCON from the modem</td>
    <td width="45%" height="30">On hook</td>
    <td width="41%" height="30"></td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stConn</td>
    <td width="48%" height="15">VCON arrived</td>
    <td width="45%" height="15">On hook - Command Voice mode</td>
    <td width="41%" height="15">GoDisc, GoTX or GoRX can be given</td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stGoTX</td>
    <td width="48%" height="15">AT#VTX is sent to the modem</td>
    <td width="45%" height="15">On hook - Command Voice mode</td>
    <td width="41%" height="15"></td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stWaitTX</td>
    <td width="48%" height="15">waiting for 'CONNECT'</td>
    <td width="45%" height="15">On hook - Command Voice mode</td>
    <td width="41%" height="15"></td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stTX</td>
    <td width="48%" height="15">'CONNECT' arrived</td>
    <td width="45%" height="15">On hook - TX mode</td>
    <td width="41%" height="15">GoEndTX can be given</td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stGoEndTX</td>
    <td width="48%" height="15">&lt;DLE&gt; &lt;ETX&gt; is sent to the modem</td>
    <td width="45%" height="15"></td>
    <td width="41%" height="15"></td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stWaitEndTX</td>
    <td width="48%" height="15">waiting for 'VCON'</td>
    <td width="45%" height="15"></td>
    <td width="41%" height="15"></td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stEndTX</td>
    <td width="48%" height="15">'VCON' arrived</td>
    <td width="45%" height="15"></td>
    <td width="41%" height="15">it goes automatically to stGoConn</td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stGoRX</td>
    <td width="48%" height="15">AT#VRX is sent to the modem</td>
    <td width="45%" height="15">On hook - Command Voice mode</td>
    <td width="41%" height="15"></td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stWaitRX</td>
    <td width="48%" height="15">waiting for 'CONNECT'</td>
    <td width="45%" height="15">On hook - Command Voice mode</td>
    <td width="41%" height="15"></td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stRX</td>
    <td width="48%" height="15">'CONNECT' arrived</td>
    <td width="45%" height="15">On hook - RX mode</td>
    <td width="41%" height="15">GoEndRX can be given</td>
  </tr>
  <tr>
    <td width="26%" height="15" align="center">stGoEndRX</td>
    <td width="48%" height="15">&lt;DLE&gt; is sent to the modem</td>
    <td width="45%" height="15"></td>
    <td width="41%" height="15"></td>
  </tr>
  <tr>
    <td width="26%" height="15"><p align="center">stWaitEndRX</td>
    <td width="48%" height="15">waiting for 'VCON'</td>
    <td width="45%" height="15"></td>
    <td width="41%" height="15"></td>
  </tr>
  <tr>
    <td width="26%" height="15"><p align="center">stEndRX</td>
    <td width="48%" height="15">'VCON' arrived</td>
    <td width="45%" height="15">On hook - Command Voice mode</td>
    <td width="41%" height="15">it goes automatically to stGoConn</td>
  </tr>
</table>

<p><b><strong><a name="ModemDialog">ModemDialog</a><br>
</strong></b>It contains the strings received from the modem.<br>
<b><strong>property ModemDialog : string;<br>
</strong></b>The last 255 characters received from the modem, and even those sent to the
modem, if modem echoes, are&nbsp; contained here. It can be used for troubleshooting or
for the sake of curiosity.</p>
</font><b><b>

<p><a name="Events"><font size="2">EVENTS</font></a></b></p>

<p><font size="2"><a name="OnConn"><strong>OnConn<br>
</strong></a></b>It is raised when the modem goes into 'VoiceCommand Mode', i.e. a
listener answered, so that TMsgVoc can play, record or simply receive DTMF keys.<br>
When a &quot;voice modem&quot; originates a call, it sends a VCON when it detects no more
&quot;ring back&quot;, supposing the remote listener has answered going off hook. See also
the commands AT#VRA and AT#VRN which should be placed in the ConnString string. If the
determination of the end of ring back is doubtful, it is better to place an A at the end
of the string ConnString, so that the event OnConn is originated immediately. This event
can be used to start playing of a file with the method Play. <br>
<b><br>
<a name="OnDTMF">OnDTMF</a><br>
</b>It is raised when a DTMF is received, i.e. when the remote listener presses a DTMF
key. The decoded DTMF keys are<br>
'0'..'9','*','#','A'..'D'<br>
besides the following special codes are used<br>
'b' for busy,'c' for ,'d' for ,'q' for ,'s' for </font><b></p>

<p><font size="2"><a name="OnEndRX">OnEndRX</a><br>
</b>It is raised whenever the modem exits the RX mode, see also GoEndRX and GetStatus.</font></p>

<p><font size="2"><b><a name="OnEndTX">OnEndTX</a><br>
</b>It is raised whenever the modem exits theTX mode, see also GoEndTX and GetStatus.</font></p>

<p><font size="2"><b><a name="OnInit">OnInit</a><br>
</b>It is raised whenever the modem has been initialized correctly with InitString.</font></p>

<p><font size="2"><b><a name="OnPlayed">OnPlayed<br>
</a></b>OnPlayed is raised after a file, set by the method Play, is played NumRep times
and completely. It can bu used to call GoEndTX or for different strategies of playing or
recording. </font></p>

<p><font size="2"><b><a name="OnRING">OnRING</a><br>
</b>It is raised every time a RING is received.</font></p>

<p><font size="2"><b><a name="OnRX">OnRX</a><br>
</b>It is raised whenever the modem enters the RX mode, see also GoRX and GetStatus.</font></p>

<p><font size="2"><b><a name="OnTX">OnTX</a><br>
</b>It is raised whenever the modem enters the TX mode, see also GoTX and GetStatus.</font></p>

<p><b>&nbsp;</p>

<p align="center"><font color="#008040" size="2">This page was written by</font><font size="2"> <a href="mailto:guido@sienanet.it.">guido@sienanet.it <img src="images/mail.gif" alt="posta.gif (838 byte)" WIDTH="29" HEIGHT="18"></a><br>
</font></p>
</b>
</body>
</html>

⌨️ 快捷键说明

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