home *** CD-ROM | disk | FTP | other *** search
- package javax.sound.sampled;
-
- public class AudioFormat {
- protected Encoding encoding;
- protected float sampleRate;
- protected int sampleSizeInBits;
- protected int channels;
- protected int frameSize;
- protected float frameRate;
- protected boolean bigEndian;
-
- public AudioFormat(Encoding var1, float var2, int var3, int var4, int var5, float var6, boolean var7) {
- this.encoding = var1;
- this.sampleRate = var2;
- this.sampleSizeInBits = var3;
- this.channels = var4;
- this.frameSize = var5;
- this.frameRate = var6;
- this.bigEndian = var7;
- }
-
- public AudioFormat(float var1, int var2, int var3, boolean var4, boolean var5) {
- this(var4 ? javax.sound.sampled.AudioFormat.Encoding.PCM_SIGNED : javax.sound.sampled.AudioFormat.Encoding.PCM_UNSIGNED, var1, var2, var3, var2 * var3 / 8, var1, var5);
- }
-
- public Encoding getEncoding() {
- return this.encoding;
- }
-
- public float getSampleRate() {
- return this.sampleRate;
- }
-
- public int getSampleSizeInBits() {
- return this.sampleSizeInBits;
- }
-
- public int getChannels() {
- return this.channels;
- }
-
- public int getFrameSize() {
- return this.frameSize;
- }
-
- public float getFrameRate() {
- return this.frameRate;
- }
-
- public boolean isBigEndian() {
- return this.bigEndian;
- }
-
- public boolean matches(AudioFormat var1) {
- return var1.getEncoding() == this.getEncoding() && (var1.getSampleRate() == -1.0F || var1.getSampleRate() == this.getSampleRate()) && var1.getSampleSizeInBits() == this.getSampleSizeInBits() && var1.getChannels() == this.getChannels() && var1.getFrameSize() == this.getFrameSize() && (var1.getFrameRate() == -1.0F || var1.getFrameRate() == this.getFrameRate()) && (var1.getSampleSizeInBits() <= 8 || var1.isBigEndian() == this.isBigEndian());
- }
-
- public String toString() {
- return this.getEncoding() + ", " + this.sampleRate + " Hz, " + this.sampleSizeInBits + " bit, " + (this.channels == 2 ? "stereo, " : "mono, ") + (this.sampleSizeInBits > 8 ? (this.bigEndian ? "big-endian, " : "little-endian, ") : "") + "audio data";
- }
- }
-