当前位置: 首页>>代码示例>>Java>>正文


Java AudioFileWriter.isFileTypeSupported方法代码示例

本文整理汇总了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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:AudioSystem.java

示例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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:AudioSystem.java

示例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");
}
 
开发者ID:vilie,项目名称:javify,代码行数:25,代码来源:AudioSystem.java

示例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");
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:25,代码来源:AudioSystem.java

示例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");
}
 
开发者ID:cfriedt,项目名称:classpath,代码行数:25,代码来源:AudioSystem.java


注:本文中的javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。