📄 audiosystem.html
字号:
a mixer installed on the system<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/AudioSystem.html#getMixerInfo()"><CODE>getMixerInfo()</CODE></A></DL></DD></DL><HR><A NAME="getSourceLineInfo(javax.sound.sampled.Line.Info)"><!-- --></A><H3>getSourceLineInfo</H3><PRE>public static <A HREF="../../../javax/sound/sampled/Line.Info.html">Line.Info</A>[] <B>getSourceLineInfo</B>(<A HREF="../../../javax/sound/sampled/Line.Info.html">Line.Info</A> info)</PRE><DL><DD>Obtains information about source lines of a particular type that are supported by any installed mixer.<DD><DL><DT><B>Parameters:</B><DD><CODE>info</CODE> - a <code>Line.Info</code> object that specifies the kind of lines about which information is requested<DT><B>Returns:</B><DD>an array of <code>Line.Info</code> objects describing source lines matching the type requested. If no matching source lines are supported, an array of length 0 is returned.<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/Mixer.html#getSourceLineInfo(javax.sound.sampled.Line.Info)"><CODE>Mixer.getSourceLineInfo(Line.Info)</CODE></A></DL></DD></DL><HR><A NAME="getTargetLineInfo(javax.sound.sampled.Line.Info)"><!-- --></A><H3>getTargetLineInfo</H3><PRE>public static <A HREF="../../../javax/sound/sampled/Line.Info.html">Line.Info</A>[] <B>getTargetLineInfo</B>(<A HREF="../../../javax/sound/sampled/Line.Info.html">Line.Info</A> info)</PRE><DL><DD>Obtains information about target lines of a particular type that are supported by any installed mixer.<DD><DL><DT><B>Parameters:</B><DD><CODE>info</CODE> - a <code>Line.Info</code> object that specifies the kind of lines about which information is requested<DT><B>Returns:</B><DD>an array of <code>Line.Info</code> objects describing target lines matching the type requested. If no matching target lines are supported, an array of length 0 is returned.<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/Mixer.html#getTargetLineInfo(javax.sound.sampled.Line.Info)"><CODE>Mixer.getTargetLineInfo(Line.Info)</CODE></A></DL></DD></DL><HR><A NAME="isLineSupported(javax.sound.sampled.Line.Info)"><!-- --></A><H3>isLineSupported</H3><PRE>public static boolean <B>isLineSupported</B>(<A HREF="../../../javax/sound/sampled/Line.Info.html">Line.Info</A> info)</PRE><DL><DD>Indicates whether the the system supports any lines that match the specified <code>Line.Info</code> object. A line is supported if any installed mixer supports it.<DD><DL><DT><B>Parameters:</B><DD><CODE>info</CODE> - a <code>Line.Info</code> object describing the line for which support is queried<DT><B>Returns:</B><DD><code>true</code> if at least one matching line is supported, otherwise <code>false</code><DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/Mixer.html#isLineSupported(javax.sound.sampled.Line.Info)"><CODE>Mixer.isLineSupported(Line.Info)</CODE></A></DL></DD></DL><HR><A NAME="getLine(javax.sound.sampled.Line.Info)"><!-- --></A><H3>getLine</H3><PRE>public static <A HREF="../../../javax/sound/sampled/Line.html">Line</A> <B>getLine</B>(<A HREF="../../../javax/sound/sampled/Line.Info.html">Line.Info</A> info) throws <A HREF="../../../javax/sound/sampled/LineUnavailableException.html">LineUnavailableException</A></PRE><DL><DD>Obtains a line that matches the description in the specified <code>Line.Info</code> object.<DD><DL><DT><B>Parameters:</B><DD><CODE>info</CODE> - a <code>Line.Info</code> object describing the desired kind of line<DT><B>Returns:</B><DD>a line of the requested kind<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/sound/sampled/LineUnavailableException.html">LineUnavailableException</A></CODE> - if a matching line is not available due to resource restrictions<DD><CODE><A HREF="../../../java/lang/SecurityException.html">SecurityException</A></CODE> - if a matching line is not available due to security restrictions<DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the system does not support at least one line matching the specified <code>Line.Info</code> object through any installed mixer</DL></DD></DL><HR><A NAME="getTargetEncodings(javax.sound.sampled.AudioFormat.Encoding)"><!-- --></A><H3>getTargetEncodings</H3><PRE>public static <A HREF="../../../javax/sound/sampled/AudioFormat.Encoding.html">AudioFormat.Encoding</A>[] <B>getTargetEncodings</B>(<A HREF="../../../javax/sound/sampled/AudioFormat.Encoding.html">AudioFormat.Encoding</A> sourceEncoding)</PRE><DL><DD>Obtains the encodings that the system can obtain from an audio input stream with the specified encoding using the set of installed format converters.<DD><DL><DT><B>Parameters:</B><DD><CODE>sourceEncoding</CODE> - the encoding for which conversion support is queried<DT><B>Returns:</B><DD>array of encodings. The array will always have a length of at least 1, representing the current encoding (no conversion).</DL></DD></DL><HR><A NAME="getTargetEncodings(javax.sound.sampled.AudioFormat)"><!-- --></A><H3>getTargetEncodings</H3><PRE>public static <A HREF="../../../javax/sound/sampled/AudioFormat.Encoding.html">AudioFormat.Encoding</A>[] <B>getTargetEncodings</B>(<A HREF="../../../javax/sound/sampled/AudioFormat.html">AudioFormat</A> sourceFormat)</PRE><DL><DD>Obtains the encodings that the system can obtain from an audio input stream with the specified format using the set of installed format converters.<DD><DL><DT><B>Parameters:</B><DD><CODE>sourceFormat</CODE> - the audio format for which conversion is queried<DT><B>Returns:</B><DD>array of encodings. The array will always have a length of at least 1, representing the current encoding (no conversion).</DL></DD></DL><HR><A NAME="isConversionSupported(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioFormat)"><!-- --></A><H3>isConversionSupported</H3><PRE>public static boolean <B>isConversionSupported</B>(<A HREF="../../../javax/sound/sampled/AudioFormat.Encoding.html">AudioFormat.Encoding</A> targetEncoding, <A HREF="../../../javax/sound/sampled/AudioFormat.html">AudioFormat</A> sourceFormat)</PRE><DL><DD>Indicates whether an audio input stream of the specified encoding can be obtained from an audio input stream that has the specified format.<DD><DL><DT><B>Parameters:</B><DD><CODE>targetEncoding</CODE> - the desired encoding after conversion<DD><CODE>sourceFormat</CODE> - the audio format before conversion<DT><B>Returns:</B><DD><code>true</code> if the conversion is supported, otherwise <code>false</code></DL></DD></DL><HR><A NAME="getAudioInputStream(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioInputStream)"><!-- --></A><H3>getAudioInputStream</H3><PRE>public static <A HREF="../../../javax/sound/sampled/AudioInputStream.html">AudioInputStream</A> <B>getAudioInputStream</B>(<A HREF="../../../javax/sound/sampled/AudioFormat.Encoding.html">AudioFormat.Encoding</A> targetEncoding, <A HREF="../../../javax/sound/sampled/AudioInputStream.html">AudioInputStream</A> sourceStream)</PRE><DL><DD>Obtains an audio input stream of the indicated encoding, by converting the provided audio input stream.<DD><DL><DT><B>Parameters:</B><DD><CODE>targetEncoding</CODE> - the desired encoding after conversion<DD><CODE>sourceStream</CODE> - the stream to be converted<DT><B>Returns:</B><DD>an audio input stream of the indicated encoding<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the conversion is not supported<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/AudioSystem.html#getTargetEncodings(javax.sound.sampled.AudioFormat.Encoding)"><CODE>getTargetEncodings(AudioFormat.Encoding)</CODE></A>, <A HREF="../../../javax/sound/sampled/AudioSystem.html#getTargetEncodings(javax.sound.sampled.AudioFormat)"><CODE>getTargetEncodings(AudioFormat)</CODE></A>, <A HREF="../../../javax/sound/sampled/AudioSystem.html#isConversionSupported(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioFormat)"><CODE>isConversionSupported(AudioFormat.Encoding, AudioFormat)</CODE></A>, <A HREF="../../../javax/sound/sampled/AudioSystem.html#getAudioInputStream(javax.sound.sampled.AudioFormat, javax.sound.sampled.AudioInputStream)"><CODE>getAudioInputStream(AudioFormat, AudioInputStream)</CODE></A></DL></DD></DL><HR><A NAME="getTargetFormats(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioFormat)"><!-- --></A><H3>getTargetFormats</H3><PRE>public static <A HREF="../../../javax/sound/sampled/AudioFormat.html">AudioFormat</A>[] <B>getTargetFormats</B>(<A HREF="../../../javax/sound/sampled/AudioFormat.Encoding.html">AudioFormat.Encoding</A> targetEncoding, <A HREF="../../../javax/sound/sampled/AudioFormat.html">AudioFormat</A> sourceFormat)</PRE><DL><DD>Obtains the formats that have a particular encoding and that the system can obtain from a stream of the specified format using the set of installed format converters.<DD><DL><DT><B>Parameters:</B><DD><CODE>targetEncoding</CODE> - the desired encoding after conversion<DD><CODE>sourceFormat</CODE> - the audio format before conversion<DT><B>Returns:</B><DD>array of formats. If no formats of the specified encoding are supported, an array of length 0 is returned.</DL></DD></DL><HR><A NAME="isConversionSupported(javax.sound.sampled.AudioFormat, javax.sound.sampled.AudioFormat)"><!-- --></A><H3>isConversionSupported</H3><PRE>public static boolean <B>isConversionSupported</B>(<A HREF="../../../javax/sound/sampled/AudioFormat.html">AudioFormat</A> targetFormat, <A HREF="../../../javax/sound/sampled/AudioFormat.html">AudioFormat</A> sourceFormat)</PRE><DL><DD>Indicates whether an audio input stream of a specified format can be obtained from an audio input stream of another specified format.<DD><DL><DT><B>Parameters:</B><DD><CODE>targetFormat</CODE> - the desired audio format after conversion<DD><CODE>sourceFormat</CODE> - the audio format before conversion<DT><B>Returns:</B><DD><code>true</code> if the conversion is supported, otherwise <code>false</code></DL></DD></DL><HR><A NAME="getAudioInputStream(javax.sound.sampled.AudioFormat, javax.sound.sampled.AudioInputStream)"><!-- --></A><H3>getAudioInputStream</H3><PRE>public static <A HREF="../../../javax/sound/sampled/AudioInputStream.html">AudioInputStream</A> <B>getAudioInputStream</B>(<A HREF="../../../javax/sound/sampled/AudioFormat.html">AudioFormat</A> targetFormat, <A HREF="../../../javax/sound/sampled/AudioInputStream.html">AudioInputStream</A> sourceStream)</PRE><DL><DD>Obtains an audio input stream of the indicated format, by converting the provided audio input stream.<DD><DL><DT><B>Parameters:</B><DD><CODE>targetFormat</CODE> - the desired audio format after conversion<DD><CODE>sourceStream</CODE> - the stream to be converted<DT><B>Returns:</B><DD>an audio input stream of the indicated format<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the conversion is not supported #see #getTargetEncodings(AudioFormat)<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/AudioSystem.html#getTargetFormats(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioFormat)"><CODE>getTargetFormats(AudioFormat.Encoding, AudioFormat)</CODE></A>, <A HREF="../../../javax/sound/sampled/AudioSystem.html#isConversionSupported(javax.sound.sampled.AudioFormat, javax.sound.sampled.AudioFormat)"><CODE>isConversionSupported(AudioFormat, AudioFormat)</CODE></A>, <A HREF="../../../javax/sound/sampled/AudioSystem.html#getAudioInputStream(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioInputStream)"><CODE>getAudioInputStream(AudioFormat.Encoding, AudioInputStream)</CODE></A></DL></DD></DL><HR><A NAME="getAudioFileFormat(java.io.InputStream)"><!-- --></A><H3>getAudioFileFormat</H3><PRE>public static <A HREF="../../../javax/sound/sampled/AudioFileFormat.html">AudioFileFormat</A> <B>getAudioFileFormat</B>(<A HREF="../../../java/io/InputStream.html">InputStream</A> stream) throws <A HREF="../../../javax/sound/sampled/UnsupportedAudioFileException.html">UnsupportedAudioFileException</A>, <A HREF="../../../java/io/IOException.html">IOException</A></PRE><DL><DD>Obtains the audio file format of the provided input stream. The stream must point to valid audio file data. The implementation of this method may require multiple parsers to examine the stream to determine whether they support it. These parsers must be able to mark the stream, read enough data to determine whether they support the stream, and, if not, reset the stream's read pointer to its original position. If the input stream does not support these operations, this method may fail with an <code>IOException</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>stream</CODE> - the input stream from which file format information should be extracted<DT><B>Returns:</B><DD>an <code>AudioFileFormat</code> object describing the stream's audio file format<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/sound/sampled/UnsupportedAudioFileException.html">UnsupportedAudioFileException</A></CODE> - if the stream does not point to valid audio file data recognized by the system<DD><CODE><A HREF="../../../java/io/IOException.html">IOException</A></CODE> - if an input/output exception occurs<DT><B>See Also: </B><DD><A HREF="../../../java/io/InputStream.html#markSupported()"><CODE>InputStream.markSupported()</CODE></A>, <A HREF="../../../java/io/InputStream.html#mark(int)"><CODE>InputStream.mark(int)</CODE></A></DL></DD></DL><HR><A NAME="getAudioFileFormat(java.net.URL)"><!-- --></A><H3>getAudioFileFormat</H3><PRE>public static <A HREF="../../../javax/sound/sampled/AudioFileFormat.html">AudioFileFormat</A> <B>getAudioFileFormat</B>(<A HREF="../../../java/net/URL.html">URL</A> url) throws <A HREF="../../../javax/sound/sampled/UnsupportedAudioFileException.html">UnsupportedAudioFileException</A>, <A HREF="../../../java/io/IOException.html">IOException</A></PRE><DL><DD>Obtains the audio file format of the specified URL. The URL must point to valid audio file data.<DD><DL><DT><B>Parameters:</B><DD><CODE>url</CODE> - the URL from which file format information should be extracted<DT><B>Returns:</B><DD>an <code>AudioFileFormat</code> object describing the audio file format<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/sound/sampled/UnsupportedAudioFileException.html">UnsupportedAudioFileException</A></CODE> - if the URL does not point to valid audio file data recognized by the system<DD><CODE><A HREF="../../../java/io/IOException.html">IOException</A></CODE> - if an input/output exception occurs</DL></DD></DL><HR><A NAME="getAudioFileFormat(java.io.File)"><!-- --></A><H3>getAudioFileFormat</H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -