/**
* Indicates whether an audio input stream of a specified format can be
* obtained from an audio input stream of another specified format.
*
* @param targetFormat the desired audio format after conversion
* @param sourceFormat the audio format before conversion
* @return {@code true} if the conversion is supported, otherwise
* {@code false}
* @throws NullPointerException if {@code targetFormat} or
* {@code sourceFormat} are {@code null}
*/
public static boolean isConversionSupported(AudioFormat targetFormat, AudioFormat sourceFormat) {
Objects.requireNonNull(targetFormat);
Objects.requireNonNull(sourceFormat);
if (sourceFormat.matches(targetFormat)) {
return true;
}
List<FormatConversionProvider> codecs = getFormatConversionProviders();
for(int i=0; i<codecs.size(); i++ ) {
FormatConversionProvider codec = codecs.get(i);
if(codec.isConversionSupported(targetFormat, sourceFormat) ) {
return true;
}
}
return false;
}
AudioSystem.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:openjdk9
作者:
评论列表
文章目录