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

📄 clip.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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:53 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Interface  Clip</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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Clip.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;PREV CLASS&nbsp;&nbsp;<A HREF="../../../javax/sound/sampled/DataLine.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Clip.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<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  Clip</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>Clip</B><DT>extends <A HREF="../../../javax/sound/sampled/DataLine.html">DataLine</A></DL><P>The <code>Clip</code> interface represents a special kind of data line whose   audio data can be loaded prior to playback, instead of being streamed in  real time. <p> Because the data is pre-loaded and has a known length, you can set a clip to start playing at any position in its audio data.  You can also create a  loop, so that when the clip is played it will cycle repeatedly.  Loops are specified with a starting and ending sample frame, along with the number of times that the loop should be played. <p> Clips may be obtained from a <code><A HREF="../../../javax/sound/sampled/Mixer.html"><CODE>Mixer</CODE></A></code> that supports lines  of this type.  Data is loaded into a clip when it is opened. <p> Playback of an audio clip may be started and stopped using the <code>start</code> and <code>stop</code> methods.  These methods do not reset the media position; <code>start</code> causes playback to continue from the position where playback was last stopped.  To restart playback from the beginning of the clip's audio data, simply follow the invocation of <code><A HREF="../../../javax/sound/sampled/DataLine.html#stop()"><CODE>stop</CODE></A></code> with setFramePosition(0), which rewinds the media to the beginning  of the clip.<P><DL><DT><B>Since: </B><DD>1.3</DD></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>&nbsp;<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>&nbsp;<!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/sampled/Clip.html#LOOP_CONTINUOUSLY">LOOP_CONTINUOUSLY</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A value indicating that looping should continue indefinitely rather than complete after a specific number of loops.</TD></TR></TABLE>&nbsp;<!-- ======== 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>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/sampled/Clip.html#getFrameLength()">getFrameLength</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Obtains the media length in sample frames.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/sampled/Clip.html#getMicrosecondLength()">getMicrosecondLength</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Obtains the media duration in microseconds</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/sampled/Clip.html#loop(int)">loop</A></B>(int&nbsp;count)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Starts looping playback from the current position.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/sampled/Clip.html#open(javax.sound.sampled.AudioFormat, byte[], int, int)">open</A></B>(<A HREF="../../../javax/sound/sampled/AudioFormat.html">AudioFormat</A>&nbsp;format,     byte[]&nbsp;data,     int&nbsp;offset,     int&nbsp;bufferSize)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Opens the clip, meaning that it should 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>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/sampled/Clip.html#open(javax.sound.sampled.AudioInputStream)">open</A></B>(<A HREF="../../../javax/sound/sampled/AudioInputStream.html">AudioInputStream</A>&nbsp;stream)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Opens the clip with the format and audio data present in the provided audio input stream.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/sampled/Clip.html#setFramePosition(int)">setFramePosition</A></B>(int&nbsp;frames)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the media position in sample frames.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/sampled/Clip.html#setLoopPoints(int, int)">setLoopPoints</A></B>(int&nbsp;start,              int&nbsp;end)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the first and last sample frames that will be played in the loop.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/sound/sampled/Clip.html#setMicrosecondPosition(long)">setMicrosecondPosition</A></B>(long&nbsp;microseconds)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the media position in microseconds.</TD></TR></TABLE>&nbsp;<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>&nbsp;<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>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="LOOP_CONTINUOUSLY"><!-- --></A><H3>LOOP_CONTINUOUSLY</H3><PRE>public static final int <B>LOOP_CONTINUOUSLY</B></PRE><DL><DD>A value indicating that looping should continue indefinitely rather than complete after a specific number of loops.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/Clip.html#loop(int)"><CODE>loop(int)</CODE></A></DL></DD></DL><!-- ========= CONSTRUCTOR DETAIL ======== -->

⌨️ 快捷键说明

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