uTools-Manuals/docs/java/javax/sound/sampled/spi/AudioFileWriter.html

321 lines
16 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="header">
<div class="subTitle">
javax.sound.sampled.spi
</div>
<h2 class="title" title="Class AudioFileWriter">Class AudioFileWriter</h2>
</div><div class="contentContainer">
<ul class="inheritance">
<li><a href="../../../../java/lang/Object.html" title="class in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>javax.sound.sampled.spi.AudioFileWriter</li>
</ul> </li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr/> <br/> <pre>public abstract class <span class="typeNameLabel">AudioFileWriter</span>
extends <a href="../../../../java/lang/Object.html" title="class in java.lang">Object</a></pre>
<div class="block">
<span>音频文件写入服务提供商。</span>
<span>提供具体实现的类可以从音频流中写入一种或多种类型的音频文件。</span>
</div>
<dl>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.3
</dd>
</dl> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- --> </a> <h3>构造方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Constructor Summary table, listing constructors, and an explanation">
<caption>
<span>构造方法</span>
<span class="tabEnd"> </span>
</caption>
<tbody>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../javax/sound/sampled/spi/AudioFileWriter.html#AudioFileWriter--">AudioFileWriter</a></span>()</code> </td>
</tr>
</tbody>
</table> </li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- --> </a> <h3>方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption>
<span class="activeTableTab" id="t0"><span>所有方法</span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t2"><span><a href="javascript:show(2);">接口方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t3"><span><a href="javascript:show(4);">抽象方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t4"><span><a href="javascript:show(8);">具体的方法</a></span><span class="tabEnd"> </span></span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor" id="i0">
<td class="colFirst"><code>abstract <a href="../../../../javax/sound/sampled/AudioFileFormat.Type.html" title="class in javax.sound.sampled">AudioFileFormat.Type</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/sound/sampled/spi/AudioFileWriter.html#getAudioFileTypes--">getAudioFileTypes</a></span>()</code>
<div class="block">
获取此音频文件写入程序提供的文件写入支持的文件类型。
</div> </td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>abstract <a href="../../../../javax/sound/sampled/AudioFileFormat.Type.html" title="class in javax.sound.sampled">AudioFileFormat.Type</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/sound/sampled/spi/AudioFileWriter.html#getAudioFileTypes-javax.sound.sampled.AudioInputStream-">getAudioFileTypes</a></span>(<a href="../../../../javax/sound/sampled/AudioInputStream.html" title="class in javax.sound.sampled">AudioInputStream</a> stream)</code>
<div class="block">
获取音频文件写入器可以从指定的音频输入流中写入的文件类型。
</div> </td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/sound/sampled/spi/AudioFileWriter.html#isFileTypeSupported-javax.sound.sampled.AudioFileFormat.Type-">isFileTypeSupported</a></span>(<a href="../../../../javax/sound/sampled/AudioFileFormat.Type.html" title="class in javax.sound.sampled">AudioFileFormat.Type</a> fileType)</code>
<div class="block">
指示此音频文件写入器是否提供对指定文件类型的文件写入支持。
</div> </td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/sound/sampled/spi/AudioFileWriter.html#isFileTypeSupported-javax.sound.sampled.AudioFileFormat.Type-javax.sound.sampled.AudioInputStream-">isFileTypeSupported</a></span>(<a href="../../../../javax/sound/sampled/AudioFileFormat.Type.html" title="class in javax.sound.sampled">AudioFileFormat.Type</a> fileType, <a href="../../../../javax/sound/sampled/AudioInputStream.html" title="class in javax.sound.sampled">AudioInputStream</a> stream)</code>
<div class="block">
指示是否可以从指定的音频输入流中写入指定类型的音频文件。
</div> </td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/sound/sampled/spi/AudioFileWriter.html#write-javax.sound.sampled.AudioInputStream-javax.sound.sampled.AudioFileFormat.Type-java.io.File-">write</a></span>(<a href="../../../../javax/sound/sampled/AudioInputStream.html" title="class in javax.sound.sampled">AudioInputStream</a> stream, <a href="../../../../javax/sound/sampled/AudioFileFormat.Type.html" title="class in javax.sound.sampled">AudioFileFormat.Type</a> fileType, <a href="../../../../java/io/File.html" title="class in java.io">File</a> out)</code>
<div class="block">
将表示所提供的外部文件的文件格式的音频文件的字节流写入。
</div> </td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/sound/sampled/spi/AudioFileWriter.html#write-javax.sound.sampled.AudioInputStream-javax.sound.sampled.AudioFileFormat.Type-java.io.OutputStream-">write</a></span>(<a href="../../../../javax/sound/sampled/AudioInputStream.html" title="class in javax.sound.sampled">AudioInputStream</a> stream, <a href="../../../../javax/sound/sampled/AudioFileFormat.Type.html" title="class in javax.sound.sampled">AudioFileFormat.Type</a> fileType, <a href="../../../../java/io/OutputStream.html" title="class in java.io">OutputStream</a> out)</code>
<div class="block">
写入表示所提供的输出流的文件类型的音频文件的字节流。
</div> </td>
</tr>
</tbody>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- --> </a> <h3>Methods inherited from class java.lang.<a href="../../../../java/lang/Object.html" title="class in java.lang">Object</a></h3> <code><a href="../../../../java/lang/Object.html#clone--">clone</a>, <a href="../../../../java/lang/Object.html#equals-java.lang.Object-">equals</a>, <a href="../../../../java/lang/Object.html#finalize--">finalize</a>, <a href="../../../../java/lang/Object.html#getClass--">getClass</a>, <a href="../../../../java/lang/Object.html#hashCode--">hashCode</a>, <a href="../../../../java/lang/Object.html#notify--">notify</a>, <a href="../../../../java/lang/Object.html#notifyAll--">notifyAll</a>, <a href="../../../../java/lang/Object.html#toString--">toString</a>, <a href="../../../../java/lang/Object.html#wait--">wait</a>, <a href="../../../../java/lang/Object.html#wait-long-">wait</a>, <a href="../../../../java/lang/Object.html#wait-long-int-">wait</a></code></li>
</ul> </li>
</ul> </li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- --> </a> <h3>构造方法详细信息</h3> <a name="AudioFileWriter--">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>AudioFileWriter</h4> <pre>public AudioFileWriter()</pre> </li>
</ul> </li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- --> </a> <h3>方法详细信息</h3> <a name="getAudioFileTypes--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getAudioFileTypes</h4> <pre>public abstract <a href="../../../../javax/sound/sampled/AudioFileFormat.Type.html" title="class in javax.sound.sampled">AudioFileFormat.Type</a>[] getAudioFileTypes()</pre>
<div class="block">
获取此音频文件写入程序提供的文件写入支持的文件类型。
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<span>文件类型数组。</span>
<span>如果不支持文件类型则返回长度为0的数组。</span>
</dd>
</dl> </li>
</ul> <a name="isFileTypeSupported-javax.sound.sampled.AudioFileFormat.Type-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isFileTypeSupported</h4> <pre>public boolean isFileTypeSupported(<a href="../../../../javax/sound/sampled/AudioFileFormat.Type.html" title="class in javax.sound.sampled">AudioFileFormat.Type</a> fileType)</pre>
<div class="block">
指示此音频文件写入器是否提供对指定文件类型的文件写入支持。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>fileType</code> - 查询写入功能的文件类型
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<code>true</code>如果文件类型是支持,否则
<code>false</code>
</dd>
</dl> </li>
</ul> <a name="getAudioFileTypes-javax.sound.sampled.AudioInputStream-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getAudioFileTypes</h4> <pre>public abstract <a href="../../../../javax/sound/sampled/AudioFileFormat.Type.html" title="class in javax.sound.sampled">AudioFileFormat.Type</a>[] getAudioFileTypes(<a href="../../../../javax/sound/sampled/AudioInputStream.html" title="class in javax.sound.sampled">AudioInputStream</a> stream)</pre>
<div class="block">
获取音频文件写入器可以从指定的音频输入流中写入的文件类型。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>stream</code> - 查询音频文件类型支持的音频输入流
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<span>文件类型数组。</span>
<span>如果不支持文件类型则返回长度为0的数组。</span>
</dd>
</dl> </li>
</ul> <a name="isFileTypeSupported-javax.sound.sampled.AudioFileFormat.Type-javax.sound.sampled.AudioInputStream-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isFileTypeSupported</h4> <pre>public boolean isFileTypeSupported(<a href="../../../../javax/sound/sampled/AudioFileFormat.Type.html" title="class in javax.sound.sampled">AudioFileFormat.Type</a> fileType,
<a href="../../../../javax/sound/sampled/AudioInputStream.html" title="class in javax.sound.sampled">AudioInputStream</a> stream)</pre>
<div class="block">
指示是否可以从指定的音频输入流中写入指定类型的音频文件。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>fileType</code> - 查询写入功能的文件类型
</dd>
<dd>
<code>stream</code> - 查询文件写入支持
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<code>true</code>如果该音频输入流支持文件类型,否则为
<code>false</code>
</dd>
</dl> </li>
</ul> <a name="write-javax.sound.sampled.AudioInputStream-javax.sound.sampled.AudioFileFormat.Type-java.io.OutputStream-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>write</h4> <pre>public abstract int write(<a href="../../../../javax/sound/sampled/AudioInputStream.html" title="class in javax.sound.sampled">AudioInputStream</a> stream,
<a href="../../../../javax/sound/sampled/AudioFileFormat.Type.html" title="class in javax.sound.sampled">AudioFileFormat.Type</a> fileType,
<a href="../../../../java/io/OutputStream.html" title="class in java.io">OutputStream</a> out)
throws <a href="../../../../java/io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">
<span>写入表示所提供的输出流的文件类型的音频文件的字节流。</span>
<span>某些文件类型要求将长度写入文件头,并且不能从头到尾写入,除非事先知道长度。</span>
<span>如果音频文件格式的长度为<code>AudioSystem.NOT_SPECIFIED</code>,则写入此类文件类型的尝试将失败,并导致<a href="../../../../javax/sound/sampled/AudioSystem.html#NOT_SPECIFIED">IOException</a></span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>stream</code> - 包含要写入输出流的音频数据的音频输入流
</dd>
<dd>
<code>fileType</code> - 要写入输出流的文件类型
</dd>
<dd>
<code>out</code> - 要写入文件数据的流
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
写入输出流的字节数
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../../../java/io/IOException.html" title="class in java.io">IOException</a></code> - 如果发生I / O异常
</dd>
<dd>
<code><a href="../../../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - 如果系统不支持文件类型
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../../javax/sound/sampled/spi/AudioFileWriter.html#isFileTypeSupported-javax.sound.sampled.AudioFileFormat.Type-javax.sound.sampled.AudioInputStream-"><code>isFileTypeSupported(AudioFileFormat.Type, AudioInputStream)</code></a>
<a href="../../../../javax/sound/sampled/spi/AudioFileWriter.html#getAudioFileTypes--"><code>getAudioFileTypes()</code></a>
</dd>
</dl> </li>
</ul> <a name="write-javax.sound.sampled.AudioInputStream-javax.sound.sampled.AudioFileFormat.Type-java.io.File-">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>write</h4> <pre>public abstract int write(<a href="../../../../javax/sound/sampled/AudioInputStream.html" title="class in javax.sound.sampled">AudioInputStream</a> stream,
<a href="../../../../javax/sound/sampled/AudioFileFormat.Type.html" title="class in javax.sound.sampled">AudioFileFormat.Type</a> fileType,
<a href="../../../../java/io/File.html" title="class in java.io">File</a> out)
throws <a href="../../../../java/io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">
将表示所提供的外部文件的文件格式的音频文件的字节流写入。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>stream</code> - 包含要写入文件的音频数据的音频输入流
</dd>
<dd>
<code>fileType</code> - 要写入文件的文件类型
</dd>
<dd>
<code>out</code> - 应写入文件数据的外部文件
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
写入文件的字节数
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../../../java/io/IOException.html" title="class in java.io">IOException</a></code> - 如果发生I / O异常
</dd>
<dd>
<code><a href="../../../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - 如果系统不支持文件格式
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../../javax/sound/sampled/spi/AudioFileWriter.html#isFileTypeSupported-javax.sound.sampled.AudioFileFormat.Type-"><code>isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type)</code></a>
<a href="../../../../javax/sound/sampled/spi/AudioFileWriter.html#getAudioFileTypes--"><code>getAudioFileTypes()</code></a>
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>