Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: joeshmoe/mpeg/MPEGInfo.java


1   /*
2    *  This source file is copyright (C) 1999 by joeshmoe.com
3    *  It may be freely used for non-commercial / development purposes.
4    *  Commericial use requires the payment of a nominal license fee.
5    *  Contact license@joeshmoe.com to purchase a license for commericial use.
6    *
7    *  It is requested that all users who modify this source code send their
8    *  changes to joeshmoe.com
9    * 
10   *  Bugs reports / modifications can sent to bugs@joeshmoe.com.
11   */
12  
13  package joeshmoe.mpeg;
14  
15  /**
16   * A class which implements this interface contains information about an
17   * MPEG audio file.
18   * @see MPEGProber
19   **/
20  
21  public interface MPEGInfo {
22      /**
23       * Returns the version of the MPEG audio file.
24       * <BLOCKQUOTE><B>1</B> - MPEG1<br><B>2</B> - MPEG2<br></BLOCKQUOTE>
25       * Currently, only MPEG1 and MPEG2 are supported.  MPEG2.5 files will
26       * simple be classified as MPEG2 and certain pieces of information about
27       * the files may be incorrect.
28       * @see ID3Tagger
29       **/
30      public int getVersion ();
31  
32      /**
33       * Returns the MPEG audio layer number.  Valid values are 1, 2, and 3.
34       **/
35      public int getLayer ();
36  
37      /**
38       * Returns true if the MPEG audio file has a variable bit rate (VBR), false
39       * if the bit rate is constant (CBR).
40       **/
41      public boolean isVBR ();
42  
43      /**
44       * Returns (in KB/s) the bitrate of the MPEG audio file.  For CBR
45       * files, this is the actual bitrate of the file.  For VBR, this is the
46       * average bitrate across the entire file.
47       **/
48      public int getBitrate ();
49  
50      /**
51       * Returns the sampling rate of the MPEG audio file.  The value is in
52       * samples per second.
53       **/
54      public int getSamplingRate ();
55  
56      /**
57       * Returns the channel mode of the file.  Valid values are:
58       * <BLOCKQUOTE>
59       * <B>1</B> - True stereo<br>
60       * <B>2</B> - Joint stereo<br>
61       * <B>3</B> - Dual channel (2 mono channels)<br>
62       * <B>4</B> - Single channel mono<br></blockquote>
63       **/
64      public int getChannelMode ();
65  
66      /**
67       * Returns true if the file uses intensity stereo.  This only applies
68       * if the channel mode is joint stereo.  All other channel modes will
69       * return false.  Layer 1 and layer 2 MPEG audio files will always return
70       * true.  For these files, you can call getIntensityBands to determine
71       * the frequency bands where intensity stereo is applied.  For layer 3
72       * files, this method may return false.  
73       **/
74      public boolean isIntensityStereo ();
75      
76      /**
77       * Returns true if the file uses m/s stereo.  This may return true
78       * if the file is layer 3 and channel mode is joint stereo.  
79       * All other channel modes and layers will always return false.  
80       **/
81      public boolean isMSStereo ();
82  
83      /**
84       * Returns a numeric code indicating the frequency bands for which 
85       * intensity stereo was applied.  This will return -1 for all files
86       * that are not encoded in joint stereo or for all layer 3 joint stereo
87       * files.  The valid return values are:<blockquote>
88       * <B>-1</B> - not applicable<br>
89       * <B>1</B> &nbsp;- bands 4 to 31<br>
90       * <B>2</B> &nbsp;- bands 8 to 31<br>
91       * <B>3</B> &nbsp;- bands 12 to 31<br>
92       * <B>4</B> &nbsp;- bands 16 to 31<br>
93       * </blockquote>
94       **/
95      public int getIntensityBands ();
96  
97      /**
98       * Returns the length of the audio data in milliseconds.
99       **/
100     public long getLength ();
101 
102     /**
103      * Returns the number of bytes of audio data in this file.  This number is
104      * not always equal to the actual size of the file because of extra
105      * header information and/or an ID3 tag.
106      **/
107     public long getFileSize ();
108 
109     /**
110      * Returns true if the file contains CRC protection data, false otherwise.
111      **/
112     public boolean isCRCProtected ();
113     
114     /**
115      * Returns true if the copyright bit is set, false otherwise.
116      **/
117     public boolean isCopyright ();
118 
119     /**
120      * Returns true if the original bit is set, false otherwise.
121      **/
122     public boolean isOriginal ();
123 
124     /**
125      * Returns the ID3 tag contained inside the file.  If there is no ID3
126      * tag, null is returned.
127      **/
128     public ID3Tag getID3 ();
129 }