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

📄 func1_23xh.htm

📁 TAPI Exampple
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML DIR="LTR"><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso8859-1">
</HEAD>
<TITLE>lineGenerateTone</TITLE>
<SCRIPT SRC="/library/psdk/linkcss.js"></SCRIPT>
<META NAME="MS-HKWD" CONTENT="lineGenerateTone">
<META NAME="MS-HAID" CONTENT="_tapi2_linegeneratetone">
</HEAD>
<BODY TOPMARGIN="0">

<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->
<!--SYNC_START-->
<script language="JavaScript" src='/library/synch.js'></script>
<!--SYNC_END-->

<H1><A NAME="_tapi2_linegeneratetone"></A>lineGenerateTone</H1>

<P>The <B>lineGenerateTone </B>function generates the specified inband tone over the specified call. Invoking this function with a zero for <I>dwToneMode</I> aborts the tone generation currently in progress on the specified call. Invoking <B>lineGenerateTone</B> or <A HREF="func1_8ir7.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_8ir7.htm"><B>lineGenerateDigits</B></A> while tone generation is in progress aborts the current tone generation or digit generation and initiates the generation of the newly specified tone or digits. </P>

<PRE class=syntax><B>LONG WINAPI lineGenerateTone(
  HCALL</B><I> hCall</I><B>,                      </B>
<B>  DWORD</B><I> dwToneMode</I><B>,                 </B>
<B>  DWORD</B><I> dwDuration</I><B>,                 </B>
<B>  DWORD</B><I> dwNumTones</I><B>,                 </B>
<B>  LPLINEGENERATETONE const</B><I> lpTones  </I>
<B>);</B></PRE>

<H4>Parameters</H4>

<DL>
<DT><I>hCall</I> </DT>

<DD>A handle to the call on which a tone is to be generated. The application must be an owner of the call. The call state of <I>hCall</I> can be any state. </DD>

<DT><I>dwToneMode</I> </DT>

<DD>Defines the tone to be generated. Tones can be either standard or custom. A custom tone is composed of a set of arbitrary frequencies. A small number of standard tones are predefined. The duration of the tone is specified with <I>dwDuration</I> for both standard and custom tones. The <I>dwToneMode</I> parameter can only have one bit set. If no bits are set (the value 0 is passed), tone generation is canceled. This parameter uses one of the <A HREF="constnts_5yer.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/constnts_5yer.htm">LINETONEMODE_ Constants</A>. </DD>

<DT><I>dwDuration</I> </DT>

<DD>Duration in milliseconds during which the tone should be sustained. A value of 0 for <I>dwDuration</I> uses a default duration for the specified tone. Default values are: 

<P>CUSTOM: The tone is sustained until it is shut off, usually by user interaction or an equipment time-out.


<P>RINGBACK: The tone is sustained until it is shut off, usually by user interaction or an equipment time-out.


<P>BUSY: The tone is sustained until it is shut off, usually by user interaction or an equipment time-out.


<P>BEEP: The tone is sustained until it is shut off, usually by user interaction or an equipment time-out.


<P>BILLING: Fixed (single cycle). 
</DD>

<DT><I>dwNumTones</I> </DT>

<DD>The number of entries in the <I>lpTones</I> array. This parameter is ignored if <I>dwToneMode</I> is not equal to CUSTOM. </DD>

<DT><I>lpTones</I> </DT>
</DL>

<P>A pointer to a <A HREF="struc2_838y.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc2_838y.htm"><B>LINEGENERATETONE</B></A> array that specifies the tone's components. This parameter is ignored for standard <A HREF="constnts_5yer.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/constnts_5yer.htm">LINETONEMODE_ Constants</A> tones such as LINETONEMODE_BUSY. If <I>lpTones</I> is a multifrequency tone, the various tones are played simultaneously. </P>

<H4>Return Values</H4>

<P>Returns zero if the request succeeds or a negative error number if an error occurs. Possible return values are: </P>

<P>LINEERR_INVALCALLHANDLE, LINEERR_NOTOWNER, LINEERR_INVALCALLSTATE, LINEERR_OPERATIONUNAVAIL, LINEERR_INVALPOINTER, LINEERR_OPERATIONFAILED, LINEERR_INVALTONEMODE, LINEERR_RESOURCEUNAVAIL, LINEERR_INVALTONE, LINEERR_UNINITIALIZED, LINEERR_NOMEM. </P>

<H4>Remarks</H4>

<P>The <B>lineGenerateTone</B> function is considered to have completed successfully when the tone generation has been successfully initiated, not when the generation of the tone is finished. The function allows the inband generation of several predefined tones, such as ringback, busy tones, and beep. It also allows for the fabrication of custom tones by specifying their component frequencies, cadence, and volume. Because these tones are generated as inband tones, the call would typically have to be in the <I>connected</I> state for tone generation to be effective. When the generation of the tone is complete, or when tone generation is canceled, a LINE_GENERATE message is sent to the application. </P>

<P>Only one inband generation request (tone generation or digit generation) is allowed to be in progress per call across all applications that are owners of the call. This implies that if tone generation is currently in progress on a call, invoking <A HREF="func1_8ir7.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_8ir7.htm"><B>lineGenerateDigits</B></A> cancels the tone generation. </P>

<P>If the LINEERR_INVALPOINTER error value is returned, the specified <I>lpTones</I> parameter is invalid or the value specified by the <I>dwNumTones</I> parameter is too large. </P>

<H4><A HREF="javascript:if(confirm('http://msdn.microsoft.com/library/psdk/sdkintro/guide_927n.htm  \n\n这个文件不能通过 Teleport Pro 取回, 因为 地址在一个域或为它的开始地址设定的边界的外部路径上.  \n\n你想从服务器打开它吗?'))window.location='http://msdn.microsoft.com/library/psdk/sdkintro/guide_927n.htm'" tppabs="http://msdn.microsoft.com/library/psdk/sdkintro/guide_927n.htm">Requirements</A> </H4>

<P><B>&nbsp;&nbsp;Windows NT/2000: </B>Requires Windows NT 4.0 SP3 or later.<BR>
<B>&nbsp;&nbsp;Windows 95/98: </B>Requires Windows 95 or later.<BR>
<B>&nbsp;&nbsp;Version: </B>Requires TAPI 1.3 or later.<BR>
<B>&nbsp;&nbsp;Header: </B>Declared in Tapi.h.<BR>
<B>&nbsp;&nbsp;Library: </B>Use Tapi32.lib.</P>

<H4>See Also</H4>

<P><A HREF="quickref_1okl.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/quickref_1okl.htm">TAPI 2.2 Reference Overview</A>, <A HREF="quickref_6gvn.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/quickref_6gvn.htm">Supplementary Line Service Functions</A>, <A HREF="msgs_0hnp.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/msgs_0hnp.htm">LINE_GENERATE</A>, <A HREF="func1_8ir7.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_8ir7.htm"><B>lineGenerateDigits</B></A>, <A HREF="struc2_838y.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc2_838y.htm"><B>LINEGENERATETONE</B></A></P>
<DIV CLASS="footer">Built on Monday, August 14, 2000</DIV>
<!--FOOTER_START-->
<DIV CLASS="footer" STYLE="color:#000000;font-size:90%;">
<A HREF="mailto:sdkfdbk@microsoft.com">Send feedback</A> to the Platform SDK.</P>
<P><A HREF="javascript:if(confirm('http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm  \n\n这个文件不能通过 Teleport Pro 取回, 因为 地址在一个域或为它的开始地址设定的边界的外部路径上.  \n\n你想从服务器打开它吗?'))window.location='http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm'" tppabs="http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm" TARGET="_top">&#169; 1999 Microsoft Corporation. All rights reserved. Terms of use.</A></P>
</DIV>
<!--FOOTER_END-->

</BODY>
</HTML>

⌨️ 快捷键说明

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