1 7 8 package org.jboss.media.format.audio.mpeg; 9 10 import java.io.InputStream ; 11 import java.net.URL ; 12 13 import javax.emb.Media; 14 import javax.emb.MediaException; 15 import javax.emb.MediaFormat; 16 import javax.emb.MediaHeader; 17 import javax.emb.MediaSegment; 18 19 import org.jboss.media.format.audio.AudioMediaFormat; 20 21 29 public class MpegAudioFormat extends AudioMediaFormat implements MediaFormat 30 { 31 34 public byte[] assembleContent( 35 URL mediaLocation, 36 MediaSegment[] mediaSegments) 37 throws MediaException 38 { 39 return null; 40 } 41 42 45 public MediaSegment[] disassembleContent( 46 URL mediaLocation, 47 byte[] mediaContent) 48 throws MediaException 49 { 50 return null; 51 } 52 53 56 public MediaHeader extractHeader(InputStream content) throws MediaException 57 { 58 if (null == content) 59 { 60 throw new NullPointerException (); 61 } 62 return new MpegAudioHeader(content); 63 } 64 65 68 public Media extractProxy(InputStream content) throws MediaException 69 { 70 return null; 72 } 73 74 77 public String getDefaultMimeType() 78 { 79 return "audio/mpeg"; 80 } 81 82 85 public boolean isEmbedded() 86 { 87 return false; 88 } 89 90 93 public boolean isStreamingDesirable() 94 { 95 return false; 96 } 97 98 101 public static class Version 102 { 103 106 public final static Version MPEG1 = new Version("MPEG v1"); 107 108 111 public final static Version MPEG2 = new Version("MPEG v2"); 112 113 116 public final static Version MPEG25 = new Version("MPEG v2.5"); 117 118 private final String description; 119 120 private Version(String description) 121 { 122 this.description = description; 123 } 124 125 130 public String toString() 131 { 132 return description; 133 } 134 } 135 136 139 public static class Layer 140 { 141 144 public static final Layer LAYERI = new Layer("Layer I"); 145 146 149 public static final Layer LAYERII = new Layer("Layer II"); 150 151 154 public static final Layer LAYERIII = new Layer("Layer III"); 155 156 private final String description; 157 158 private Layer(String description) 159 { 160 this.description = description; 161 } 162 163 168 public String toString() 169 { 170 return description; 171 } 172 } 173 174 177 public static class ChannelMode 178 { 179 public static final ChannelMode STEREO = new ChannelMode("Stereo"); 180 public static final ChannelMode JOINT_STEREO = 181 new ChannelMode("Joint Stereo"); 182 public static final ChannelMode DUAL_CHANNEL = 183 new ChannelMode("Dual Channel"); 184 public static final ChannelMode SINGLE_CHANNEL = new ChannelMode("Mono"); 185 186 private final String description; 187 188 private ChannelMode(String description) 189 { 190 this.description = description; 191 } 192 193 198 public String toString() 199 { 200 return description; 201 } 202 } 203 } | Popular Tags |