本文整理汇总了Java中javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes方法的典型用法代码示例。如果您正苦于以下问题:Java AudioFileWriter.getAudioFileTypes方法的具体用法?Java AudioFileWriter.getAudioFileTypes怎么用?Java AudioFileWriter.getAudioFileTypes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sound.sampled.spi.AudioFileWriter
的用法示例。
在下文中一共展示了AudioFileWriter.getAudioFileTypes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAudioFileTypes
import javax.sound.sampled.spi.AudioFileWriter; //导入方法依赖的package包/类
/**
* Obtains the file types for which file writing support is provided by the system.
* @return array of unique file types. If no file types are supported,
* an array of length 0 is returned.
*/
public static AudioFileFormat.Type[] getAudioFileTypes() {
List providers = getAudioFileWriters();
Set returnTypesSet = new HashSet();
for(int i=0; i < providers.size(); i++) {
AudioFileWriter writer = (AudioFileWriter) providers.get(i);
AudioFileFormat.Type[] fileTypes = writer.getAudioFileTypes();
for(int j=0; j < fileTypes.length; j++) {
returnTypesSet.add(fileTypes[j]);
}
}
AudioFileFormat.Type returnTypes[] = (AudioFileFormat.Type[])
returnTypesSet.toArray(new AudioFileFormat.Type[0]);
return returnTypes;
}
示例2: getAudioFileTypes
import javax.sound.sampled.spi.AudioFileWriter; //导入方法依赖的package包/类
/**
* Obtains the file types for which file writing support is provided by the
* system.
*
* @return array of unique file types. If no file types are supported, an
* array of length 0 is returned.
*/
public static AudioFileFormat.Type[] getAudioFileTypes() {
List<AudioFileWriter> providers = getAudioFileWriters();
Set<AudioFileFormat.Type> returnTypesSet = new HashSet<>();
for(int i=0; i < providers.size(); i++) {
AudioFileWriter writer = providers.get(i);
AudioFileFormat.Type[] fileTypes = writer.getAudioFileTypes();
for(int j=0; j < fileTypes.length; j++) {
returnTypesSet.add(fileTypes[j]);
}
}
AudioFileFormat.Type returnTypes[] =
returnTypesSet.toArray(new AudioFileFormat.Type[0]);
return returnTypes;
}
示例3: getAudioFileTypes
import javax.sound.sampled.spi.AudioFileWriter; //导入方法依赖的package包/类
/**
* Return an array of all the supported AudioFileFormat types.
* @return an array of unique types
*/
public static AudioFileFormat.Type[] getAudioFileTypes()
{
HashSet<AudioFileFormat.Type> result
= new HashSet<AudioFileFormat.Type>();
Iterator i = ServiceFactory.lookupProviders(AudioFileWriter.class);
while (i.hasNext())
{
AudioFileWriter writer = (AudioFileWriter) i.next();
AudioFileFormat.Type[] types = writer.getAudioFileTypes();
for (int j = 0; j < types.length; ++j)
result.add(types[j]);
}
return result.toArray(new AudioFileFormat.Type[result.size()]);
}
示例4: getAudioFileTypes
import javax.sound.sampled.spi.AudioFileWriter; //导入方法依赖的package包/类
/**
* Return an array of all the supported AudioFileFormat types.
* @return an array of unique types
*/
public static AudioFileFormat.Type[] getAudioFileTypes()
{
HashSet<AudioFileFormat.Type> result
= new HashSet<AudioFileFormat.Type>();
Iterator<AudioFileWriter> i = ServiceFactory.lookupProviders(AudioFileWriter.class);
while (i.hasNext())
{
AudioFileWriter writer = i.next();
AudioFileFormat.Type[] types = writer.getAudioFileTypes();
for (int j = 0; j < types.length; ++j)
result.add(types[j]);
}
return result.toArray(new AudioFileFormat.Type[result.size()]);
}