Wrapper for the jump3r encoder. @author Ken Handel
| 38 | * @author Ken Handel |
| 39 | */ |
| 40 | public class LameEncoder { |
| 41 | |
| 42 | public static final AudioFormat.Encoding MPEG1L3 = new AudioFormat.Encoding( |
| 43 | "MPEG1L3"); |
| 44 | // Lame converts automagically to MPEG2 or MPEG2.5, if necessary. |
| 45 | public static final AudioFormat.Encoding MPEG2L3 = new AudioFormat.Encoding( |
| 46 | "MPEG2L3"); |
| 47 | public static final AudioFormat.Encoding MPEG2DOT5L3 = new AudioFormat.Encoding( |
| 48 | "MPEG2DOT5L3"); |
| 49 | |
| 50 | // property constants |
| 51 | /** |
| 52 | * property key to read/set the VBR mode: an instance of Boolean (default: |
| 53 | * false) |
| 54 | */ |
| 55 | public static final String P_VBR = "vbr"; |
| 56 | /** |
| 57 | * property key to read/set the channel mode: a String, one of |
| 58 | * "jointstereo", "dual", "mono", |
| 59 | * "auto" (default). |
| 60 | */ |
| 61 | public static final String P_CHMODE = "chmode"; |
| 62 | /** |
| 63 | * property key to read/set the bitrate: an Integer value. Set to -1 for |
| 64 | * default bitrate. |
| 65 | */ |
| 66 | public static final String P_BITRATE = "bitrate"; |
| 67 | /** |
| 68 | * property key to read/set the quality: an Integer from 1 (highest) to 9 |
| 69 | * (lowest). |
| 70 | */ |
| 71 | public static final String P_QUALITY = "quality"; |
| 72 | |
| 73 | // constants from lame.h |
| 74 | public static final int MPEG_VERSION_2 = 0; // MPEG-2 |
| 75 | public static final int MPEG_VERSION_1 = 1; // MPEG-1 |
| 76 | public static final int MPEG_VERSION_2DOT5 = 2; // MPEG-2.5 |
| 77 | |
| 78 | // low mean bitrate in VBR mode |
| 79 | public static final int QUALITY_LOWEST = 9; |
| 80 | public static final int QUALITY_LOW = 7; |
| 81 | public static final int QUALITY_MIDDLE = 5; |
| 82 | public static final int QUALITY_HIGH = 2; |
| 83 | // quality==0 not yet coded in LAME (3.83alpha) |
| 84 | // high mean bitrate in VBR // mode |
| 85 | public static final int QUALITY_HIGHEST = 1; |
| 86 | |
| 87 | public static final int CHANNEL_MODE_STEREO = 0; |
| 88 | public static final int CHANNEL_MODE_JOINT_STEREO = 1; |
| 89 | public static final int CHANNEL_MODE_DUAL_CHANNEL = 2; |
| 90 | public static final int CHANNEL_MODE_MONO = 3; |
| 91 | |
| 92 | // channel mode has no influence on mono files. |
| 93 | public static final int CHANNEL_MODE_AUTO = -1; |
| 94 | public static final int BITRATE_AUTO = -1; |
| 95 | |
| 96 | // suggested maximum buffer size for an mpeg frame |
| 97 | private static final int DEFAULT_PCM_BUFFER_SIZE = 2048 * 16; |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…