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


Java ModelStandardTransform类代码示例

本文整理汇总了Java中com.sun.media.sound.ModelStandardTransform的典型用法代码示例。如果您正苦于以下问题:Java ModelStandardTransform类的具体用法?Java ModelStandardTransform怎么用?Java ModelStandardTransform使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ModelStandardTransform类属于com.sun.media.sound包,在下文中一共展示了ModelStandardTransform类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkLinearity

import com.sun.media.sound.ModelStandardTransform; //导入依赖的package包/类
private static boolean checkLinearity(ModelStandardTransform transform)
{
    double lastx = 0;
    for (int p = 0; p < 2; p++)
    for (int d = 0; d < 2; d++)
    for (double i = 0; i < 1.0; i+=0.001) {
        if(p == 0)
            transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR);
        else
            transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR);
        if(d == 0)
            transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX);
        else
            transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN);
        double x = transform.transform(i);
        if(i == 0)
            lastx = x;
        else
        {
            if(lastx - x > 0.2) return false;
            lastx = x;
        }
    }
    return true;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:26,代码来源:TransformLinear.java

示例2: main

import com.sun.media.sound.ModelStandardTransform; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    ModelStandardTransform transform = new ModelStandardTransform();
    transform.setTransform(ModelStandardTransform.TRANSFORM_LINEAR);
    assertTrue(checkLinearity(transform));

    transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX);
    transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR);
    assertTrue(Math.abs(transform.transform(0.2f) - 0.2f) < 0.0001f);
    assertTrue(Math.abs(transform.transform(0.8f) - 0.8f) < 0.0001f);

    transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN);
    transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR);
    assertTrue(Math.abs(transform.transform(0.2f) - 0.8f) < 0.0001f);
    assertTrue(Math.abs(transform.transform(0.8f) - 0.2f) < 0.0001f);

    transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX);
    transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR);
    assertTrue(Math.abs(transform.transform(0.2f) - (-0.6f)) < 0.0001f);
    assertTrue(Math.abs(transform.transform(0.8f) - (0.6f)) < 0.0001f);

    transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN);
    transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR);
    assertTrue(Math.abs(transform.transform(0.2f) - (0.6f)) < 0.0001f);
    assertTrue(Math.abs(transform.transform(0.8f) - (-0.6f)) < 0.0001f);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:26,代码来源:TransformLinear.java

示例3: main

import com.sun.media.sound.ModelStandardTransform; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    ModelStandardTransform transform = new ModelStandardTransform();
    transform.setTransform(ModelStandardTransform.TRANSFORM_SWITCH);

    transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX);
    transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR);
    assertTrue(Math.abs(transform.transform(0.2f) - 0.0f) < 0.0001f);
    assertTrue(Math.abs(transform.transform(0.8f) - 1.0f) < 0.0001f);

    transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN);
    transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR);
    assertTrue(Math.abs(transform.transform(0.2f) - 1.0f) < 0.0001f);
    assertTrue(Math.abs(transform.transform(0.8f) - 0.0f) < 0.0001f);

    transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX);
    transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR);
    assertTrue(Math.abs(transform.transform(0.2f) + 1.0f) < 0.0001f);
    assertTrue(Math.abs(transform.transform(0.8f) - 1.0f) < 0.0001f);

    transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN);
    transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR);
    assertTrue(Math.abs(transform.transform(0.2f) - 1.0f) < 0.0001f);
    assertTrue(Math.abs(transform.transform(0.8f) + 1.0f) < 0.0001f);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:25,代码来源:TransformSwitch.java


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