AudioSystem.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:openjdk9 作者:
/**
 * Obtains the requested audio mixer.
 *
 * @param  info a {@code Mixer.Info} object representing the desired mixer,
 *         or {@code null} for the system default mixer
 * @return the requested mixer
 * @throws SecurityException if the requested mixer is unavailable because
 *         of security restrictions
 * @throws IllegalArgumentException if the info object does not represent a
 *         mixer installed on the system
 * @see #getMixerInfo
 */
public static Mixer getMixer(final Mixer.Info info) {
    for (final MixerProvider provider : getMixerProviders()) {
        try {
            return provider.getMixer(info);
        } catch (IllegalArgumentException | NullPointerException ignored) {
            // The MixerProvider.getMixer(null) should return default Mixer,
            // This behaviour was assumed from the beginning, but strictly
            // specified only in the jdk9. Since the jdk1.1.5 we skipped
            // NPE for some reason and therefore skipped some
            // implementations of MixerProviders, which throw NPE. To keep
            // support of such implementations, we still ignore NPE.
        }
    }
    throw new IllegalArgumentException(
            String.format("Mixer not supported: %s", info));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号