Package javax.media.format

Examples of javax.media.format.AudioFormat


      // ((4/2) + 6) / 1.5 = 5.33 = 5 rounded
      // (8 + (10/2)) / 1.5 = 8.67 = 9 rounded
      // (10/2) + 12 / 1.5 = 11.33 = 11 rounded
      // (14 * (16/2)) / 1.5 = 14.67 = 15 rounded

      testnew AudioFormat(AudioFormat.LINEAR, 3000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 3000.0, Format.byteArray),
          new AudioFormat(AudioFormat.LINEAR, 2000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 2000.0, Format.byteArray),
          inputBufferData,
          targetOutputBufferData
          );
    }
  } 
View Full Code Here


  {
    {
      byte[] inputBufferData = new byte[] {2, 4};
      byte[] targetOutputBufferData = new byte[] {2, 3, 4};

      testnew AudioFormat(AudioFormat.LINEAR, 2000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 2000.0, Format.byteArray),
          new AudioFormat(AudioFormat.LINEAR, 3000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 3000.0, Format.byteArray),
          inputBufferData,
          targetOutputBufferData
          );
    }
  } 
View Full Code Here

  {
    {
      byte[] inputBufferData = new byte[] {2, 4, 6};
      byte[] targetOutputBufferData = new byte[] {2, 3, 4, 6};

      testnew AudioFormat(AudioFormat.LINEAR, 2000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 2000.0, Format.byteArray),
          new AudioFormat(AudioFormat.LINEAR, 3000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 3000.0, Format.byteArray),
          inputBufferData,
          targetOutputBufferData
          );
    }
  } 
View Full Code Here

  {
    {
      byte[] inputBufferData = new byte[] {2, 4, 6, 8};
      byte[] targetOutputBufferData = new byte[] {2, 3, 4, 6, 7, 8};

      testnew AudioFormat(AudioFormat.LINEAR, 2000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 2000.0, Format.byteArray),
          new AudioFormat(AudioFormat.LINEAR, 3000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 3000.0, Format.byteArray),
          inputBufferData,
          targetOutputBufferData
          );
    }
  } 
View Full Code Here

  {
    {
      byte[] inputBufferData = new byte[] {2, 4, 6};
      byte[] targetOutputBufferData = new byte[] {2, 3, 4, 5, 6};

      testnew AudioFormat(AudioFormat.LINEAR, 3000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 2000.0, Format.byteArray),
          new AudioFormat(AudioFormat.LINEAR, 5000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 3000.0, Format.byteArray),
          inputBufferData,
          targetOutputBufferData
          );
    }
  }
View Full Code Here

  {
    {
      byte[] inputBufferData = new byte[] {2, 4, 6, 8};
      byte[] targetOutputBufferData = new byte[] {2, 2, 4, 4, 6, 6, 8, 8};

      testnew AudioFormat(AudioFormat.LINEAR, 4000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 4000.0, Format.byteArray),
          new AudioFormat(AudioFormat.LINEAR, 4000.0, 8, 2, -1, AudioFormat.SIGNED, 16, 4000.0, Format.byteArray),
          inputBufferData,
          targetOutputBufferData
          );
    }
  } 
View Full Code Here

  {
    {
      byte[] inputBufferData = new byte[] {2, 4, 6, 8};
      byte[] targetOutputBufferData = new byte[] {2, 6};

      testnew AudioFormat(AudioFormat.LINEAR, 4000.0, 8, 2, -1, AudioFormat.SIGNED, 16, 4000.0, Format.byteArray),
          new AudioFormat(AudioFormat.LINEAR, 4000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 4000.0, Format.byteArray),
          inputBufferData,
          targetOutputBufferData
          );
    }
  } 
View Full Code Here

    {
      byte[] inputBufferData = new byte[] {0, 127, (byte) 128, (byte) 129, (byte) 255};
      byte[] targetOutputBufferData = new byte[] {-128, -1, 0, 1, 127};
     

      testnew AudioFormat(AudioFormat.LINEAR, 4000.0, 8, 1, -1, AudioFormat.UNSIGNED, 8, 4000.0, Format.byteArray),
          new AudioFormat(AudioFormat.LINEAR, 4000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 4000.0, Format.byteArray),
          inputBufferData,
          targetOutputBufferData
          );
    }
  } 
View Full Code Here

  public void test18()
  {
    {
      byte[] inputBufferData = new byte[] {-128, -1, 0, 1, 127};
      byte[] targetOutputBufferData = new byte[] {0, 127, (byte) 128, (byte) 129, (byte) 255};
      testnew AudioFormat(AudioFormat.LINEAR, 4000.0, 8, 1, -1, AudioFormat.SIGNED, 8, 4000.0, Format.byteArray),
          new AudioFormat(AudioFormat.LINEAR, 4000.0, 8, 1, -1, AudioFormat.UNSIGNED, 8, 4000.0, Format.byteArray),
          inputBufferData,
          targetOutputBufferData
          );
    }
  } 
View Full Code Here

  {
    for (int signed : signedValues)
    {
      byte[] inputBufferData = new byte[] {1, 2, 3, 4};
      byte[] targetOutputBufferData = new byte[] {2, 1, 4, 3};
      testnew AudioFormat(AudioFormat.LINEAR, 4000.0, 16, 1, AudioFormat.LITTLE_ENDIAN, signed, 16, 4000.0, Format.byteArray),
          new AudioFormat(AudioFormat.LINEAR, 4000.0, 16, 1, AudioFormat.BIG_ENDIAN, signed, 16, 4000.0, Format.byteArray),
          inputBufferData,
          targetOutputBufferData
          );
    }
  } 
View Full Code Here

TOP

Related Classes of javax.media.format.AudioFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.