📄 targetdataline.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Apr 27 23:37:55 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Interface TargetDataLine</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/TargetDataLine.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/sound/sampled/SourceDataLine.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="TargetDataLine.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.sound.sampled</FONT><BR>Interface TargetDataLine</H2><DL><DT><B>All Superinterfaces:</B> <DD><A HREF="../../../javax/sound/sampled/DataLine.html">DataLine</A>, <A HREF="../../../javax/sound/sampled/Line.html">Line</A></DD></DL><HR><DL><DT>public interface <B>TargetDataLine</B><DT>extends <A HREF="../../../javax/sound/sampled/DataLine.html">DataLine</A></DL><P>A target data line is a type of <code><A HREF="../../../javax/sound/sampled/DataLine.html"><CODE>DataLine</CODE></A></code> from which audio data can be read. The most common example is a data line that gets its data from an audio capture device. (The device is implemented as a mixer that writes to the target data line.) <p> Note that the naming convention for this interface reflects the relationship between the line and its mixer. From the perspective of an application, a target data line may act as a source for audio data. <p> The target data line can be obtained from a mixer by invoking the <code><A HREF="../../../javax/sound/sampled/Mixer.html#getLine(javax.sound.sampled.Line.Info)"><CODE>getLine</CODE></A></code> method of <code>Mixer</code> with an appropriate <code><A HREF="../../../javax/sound/sampled/DataLine.Info.html"><CODE>DataLine.Info</CODE></A></code> object. <p> The <code>TargetDataLine</code> interface provides a method for reading the captured data from the target data line's buffer.Applications that record audio should read data from the target data line quickly enough to keep the buffer from overflowing, which could cause discontinuities in the captured data that are perceived as clicks. Applications can use the <code><A HREF="../../../javax/sound/sampled/DataLine.html#available()"><CODE>available</CODE></A></code> method defined in the <code>DataLine</code> interface to determine the amount of data currently queued in the data line's buffer. If the buffer does overflow, the oldest queued data is discarded and replaced by new data.<P><DL><DT><B>Since: </B><DD>1.3</DD><DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/Mixer.html"><CODE>Mixer</CODE></A>, <A HREF="../../../javax/sound/sampled/DataLine.html"><CODE>DataLine</CODE></A>, <A HREF="../../../javax/sound/sampled/SourceDataLine.html"><CODE>SourceDataLine</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><A NAME="inner_classes_inherited_from_class_javax.sound.sampled.DataLine"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Inner classes inherited from class javax.sound.sampled.<A HREF="../../../javax/sound/sampled/DataLine.html">DataLine</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../javax/sound/sampled/DataLine.Info.html">DataLine.Info</A></CODE></TD></TR></TABLE> <A NAME="inner_classes_inherited_from_class_javax.sound.sampled.Line"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Inner classes inherited from class javax.sound.sampled.<A HREF="../../../javax/sound/sampled/Line.html">Line</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../javax/sound/sampled/Line.Info.html">Line.Info</A></CODE></TD></TR></TABLE> <!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/sampled/TargetDataLine.html#open(javax.sound.sampled.AudioFormat)">open</A></B>(<A HREF="../../../javax/sound/sampled/AudioFormat.html">AudioFormat</A> format)</CODE><BR> Opens the line with the specified format, causing the line to acquire any required system resources and become operational.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/sampled/TargetDataLine.html#open(javax.sound.sampled.AudioFormat, int)">open</A></B>(<A HREF="../../../javax/sound/sampled/AudioFormat.html">AudioFormat</A> format, int bufferSize)</CODE><BR> Opens the line with the specified format and requested buffer size, causing the line to acquire any required system resources and become operational.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/sampled/TargetDataLine.html#read(byte[], int, int)">read</A></B>(byte[] b, int off, int len)</CODE><BR> Reads audio data from the data line's input buffer.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_javax.sound.sampled.DataLine"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface javax.sound.sampled.<A HREF="../../../javax/sound/sampled/DataLine.html">DataLine</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../javax/sound/sampled/DataLine.html#available()">available</A>, <A HREF="../../../javax/sound/sampled/DataLine.html#drain()">drain</A>, <A HREF="../../../javax/sound/sampled/DataLine.html#flush()">flush</A>, <A HREF="../../../javax/sound/sampled/DataLine.html#getBufferSize()">getBufferSize</A>, <A HREF="../../../javax/sound/sampled/DataLine.html#getFormat()">getFormat</A>, <A HREF="../../../javax/sound/sampled/DataLine.html#getFramePosition()">getFramePosition</A>, <A HREF="../../../javax/sound/sampled/DataLine.html#getLevel()">getLevel</A>, <A HREF="../../../javax/sound/sampled/DataLine.html#getMicrosecondPosition()">getMicrosecondPosition</A>, <A HREF="../../../javax/sound/sampled/DataLine.html#isActive()">isActive</A>, <A HREF="../../../javax/sound/sampled/DataLine.html#isRunning()">isRunning</A>, <A HREF="../../../javax/sound/sampled/DataLine.html#start()">start</A>, <A HREF="../../../javax/sound/sampled/DataLine.html#stop()">stop</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_javax.sound.sampled.Line"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface javax.sound.sampled.<A HREF="../../../javax/sound/sampled/Line.html">Line</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../javax/sound/sampled/Line.html#addLineListener(javax.sound.sampled.LineListener)">addLineListener</A>, <A HREF="../../../javax/sound/sampled/Line.html#close()">close</A>, <A HREF="../../../javax/sound/sampled/Line.html#getControl(javax.sound.sampled.Control.Type)">getControl</A>, <A HREF="../../../javax/sound/sampled/Line.html#getControls()">getControls</A>, <A HREF="../../../javax/sound/sampled/Line.html#getLineInfo()">getLineInfo</A>, <A HREF="../../../javax/sound/sampled/Line.html#isControlSupported(javax.sound.sampled.Control.Type)">isControlSupported</A>, <A HREF="../../../javax/sound/sampled/Line.html#isOpen()">isOpen</A>, <A HREF="../../../javax/sound/sampled/Line.html#open()">open</A>, <A HREF="../../../javax/sound/sampled/Line.html#removeLineListener(javax.sound.sampled.LineListener)">removeLineListener</A></CODE></TD></TR></TABLE> <P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -