/Users/lyon/j4p/src/javax/sound/sampled/AudioFormat.java

1    // Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov. 
2    // Jad home page: http://kpdus.tripod.com/jad.html 
3    // Decompiler options: packfields(3) packimports(7) deadcode fieldsfirst splitstr(64) nonlb lnc radix(10) lradix(10)  
4    // Source File Name:   AudioFormat.java 
5     
6    package javax.sound.sampled; 
7     
8     
9    public class AudioFormat { 
10       public static class Encoding { 
11    
12                   public static final Encoding PCM_SIGNED = new Encoding("PCM_SIGNED"); 
13                   public static final Encoding PCM_UNSIGNED = new Encoding("PCM_UNSIGNED"); 
14                   public static final Encoding ULAW = new Encoding("ULAW"); 
15                   public static final Encoding ALAW = new Encoding("ALAW"); 
16                   private String name; 
17    
18                   public final boolean equals(Object obj) { 
19   /* 433*/            return super.equals(obj); 
20                   } 
21    
22                   public final int hashCode() { 
23   /* 440*/            return super.hashCode(); 
24                   } 
25    
26                   public final String toString() { 
27   /* 452*/            return name; 
28                   } 
29    
30    
31                   protected Encoding(String s) { 
32   /* 423*/            name = s; 
33                   } 
34       } 
35    
36    
37               protected Encoding encoding; 
38               protected float sampleRate, frameRate; 
39               protected int sampleSizeInBits, channels, frameSize; 
40               protected boolean bigEndian; 
41    
42               public AudioFormat(Encoding encoding1, float f, int i, int j, int k, float f1, boolean flag) { 
43   /* 140*/        encoding = encoding1; 
44   /* 141*/        sampleRate = f; 
45   /* 142*/        sampleSizeInBits = i; 
46   /* 143*/        channels = j; 
47   /* 144*/        frameSize = k; 
48   /* 145*/        frameRate = f1; 
49   /* 146*/        bigEndian = flag; 
50               } 
51    
52               public AudioFormat(float f, int i, int j, boolean flag, boolean flag1) { 
53   /* 166*/        this(!flag ? Encoding.PCM_UNSIGNED : Encoding.PCM_SIGNED, f, i, j, (i * j) / 8, f, flag1); 
54               } 
55    
56               public Encoding getEncoding() { 
57   /* 180*/        return encoding; 
58               } 
59    
60               public float getSampleRate() { 
61   /* 202*/        return sampleRate; 
62               } 
63    
64               public int getSampleSizeInBits() { 
65   /* 224*/        return sampleSizeInBits; 
66               } 
67    
68               public int getChannels() { 
69   /* 242*/        return channels; 
70               } 
71    
72               public int getFrameSize() { 
73   /* 262*/        return frameSize; 
74               } 
75    
76               public float getFrameRate() { 
77   /* 282*/        return frameRate; 
78               } 
79    
80               public boolean isBigEndian() { 
81   /* 295*/        return bigEndian; 
82               } 
83    
84               public boolean matches(AudioFormat audioformat) { 
85   /* 319*/        return audioformat.getEncoding() == getEncoding() && (audioformat.getSampleRate() == -1F || audioformat.getSampleRate() == getSampleRate()) && audioformat.getSampleSizeInBits() == getSampleSizeInBits() && audioformat.getChannels() == getChannels() && audioformat.getFrameSize() == getFrameSize() && (audioformat.getFrameRate() == -1F || audioformat.getFrameRate() == getFrameRate()) && (audioformat.getSampleSizeInBits() <= 8 || audioformat.isBigEndian() == isBigEndian()); 
86               } 
87    
88               public String toString() { 
89   /* 341*/        return getEncoding() + ", " + sampleRate + " Hz, " + sampleSizeInBits + " bit, " + (channels != 2 ? "mono, " : "stereo, ") + (sampleSizeInBits <= 8 ? "" : !bigEndian ? "little-endian, " : "big-endian, ") + "audio data"; 
90               } 
91   } 
92