本文整理汇总了Java中javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported方法的典型用法代码示例。如果您正苦于以下问题:Java AudioFileWriter.isFileTypeSupported方法的具体用法?Java AudioFileWriter.isFileTypeSupported怎么用?Java AudioFileWriter.isFileTypeSupported使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sound.sampled.spi.AudioFileWriter
的用法示例。
在下文中一共展示了AudioFileWriter.isFileTypeSupported方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isFileTypeSupported
import javax.sound.sampled.spi.AudioFileWriter; //导入方法依赖的package包/类
/**
* Indicates whether file writing support for the specified file type is provided
* by the system.
* @param fileType the file type for which write capabilities are queried
* @return <code>true</code> if the file type is supported,
* otherwise <code>false</code>
*/
public static boolean isFileTypeSupported(AudioFileFormat.Type fileType) {
List providers = getAudioFileWriters();
for(int i=0; i < providers.size(); i++) {
AudioFileWriter writer = (AudioFileWriter) providers.get(i);
if (writer.isFileTypeSupported(fileType)) {
return true;
}
}
return false;
}
示例2: isFileTypeSupported
import javax.sound.sampled.spi.AudioFileWriter; //导入方法依赖的package包/类
/**
* Indicates whether file writing support for the specified file type is
* provided by the system.
*
* @param fileType the file type for which write capabilities are queried
* @return {@code true} if the file type is supported, otherwise
* {@code false}
* @throws NullPointerException if {@code fileType} is {@code null}
*/
public static boolean isFileTypeSupported(AudioFileFormat.Type fileType) {
Objects.requireNonNull(fileType);
List<AudioFileWriter> providers = getAudioFileWriters();
for(int i=0; i < providers.size(); i++) {
AudioFileWriter writer = providers.get(i);
if (writer.isFileTypeSupported(fileType)) {
return true;
}
}
return false;
}
示例3: write
import javax.sound.sampled.spi.AudioFileWriter; //导入方法依赖的package包/类
/**
* Write an audio input stream to the given file, using the specified
* audio file format. All the providers installed on the system will
* be searched to find one that supports this operation.
* @param ais the audio input stream to write
* @param type the desired audio file format type
* @param out the file to write to
* @return the number of bytes written
* @throws IOException if an I/O error occurs while writing
* @throws IllegalArgumentException if the file type is not supported
*/
public static int write(AudioInputStream ais, AudioFileFormat.Type type,
File out)
throws IOException
{
Iterator i = ServiceFactory.lookupProviders(AudioFileWriter.class);
while (i.hasNext())
{
AudioFileWriter w = (AudioFileWriter) i.next();
if (w.isFileTypeSupported(type, ais))
return w.write(ais, type, out);
}
throw new IllegalArgumentException("file type not supported by system");
}
示例4: write
import javax.sound.sampled.spi.AudioFileWriter; //导入方法依赖的package包/类
/**
* Write an audio input stream to the given file, using the specified
* audio file format. All the providers installed on the system will
* be searched to find one that supports this operation.
* @param ais the audio input stream to write
* @param type the desired audio file format type
* @param out the file to write to
* @return the number of bytes written
* @throws IOException if an I/O error occurs while writing
* @throws IllegalArgumentException if the file type is not supported
*/
public static int write(AudioInputStream ais, AudioFileFormat.Type type,
File out)
throws IOException
{
Iterator i = ServiceFactory.lookupProviders(AudioFileWriter.class);
while (i.hasNext())
{
AudioFileWriter w = (AudioFileWriter) i.next();
if (w.isFileTypeSupported(type, ais))
return w.write(ais, type, out);
}
throw new IllegalArgumentException("file type not supported by system");
}
示例5: write
import javax.sound.sampled.spi.AudioFileWriter; //导入方法依赖的package包/类
/**
* Write an audio input stream to the given file, using the specified
* audio file format. All the providers installed on the system will
* be searched to find one that supports this operation.
* @param ais the audio input stream to write
* @param type the desired audio file format type
* @param out the file to write to
* @return the number of bytes written
* @throws IOException if an I/O error occurs while writing
* @throws IllegalArgumentException if the file type is not supported
*/
public static int write(AudioInputStream ais, AudioFileFormat.Type type,
File out)
throws IOException
{
Iterator<AudioFileWriter> i = ServiceFactory.lookupProviders(AudioFileWriter.class);
while (i.hasNext())
{
AudioFileWriter w = i.next();
if (w.isFileTypeSupported(type, ais))
return w.write(ais, type, out);
}
throw new IllegalArgumentException("file type not supported by system");
}