Fields Summary |
---|
public static final String | TYPE1 |
public static final String | TYPE2 |
public static final String | TYPE3 |
public static final String | TYPE4 |
public static final String | TYPE5 |
public static final String | TYPE7 |
public static final String | TYPE8 |
public static final String | TYPE9 |
public static final String | TYPE10 |
public static final String | TYPE11 |
public static final String | TYPE12 |
public static final String | TYPE13 |
public static final String | TYPE_ENCRYPTEDIdentifier for an encrypted audio track. |
private int | channelCount |
private int | sampleSize |
private long | sampleRate |
private int | soundVersion |
private int | compressionId |
private int | packetSize |
private long | samplesPerPacket |
private long | bytesPerPacket |
private long | bytesPerFrame |
private long | bytesPerSample |
private int | reserved1 |
private long | reserved2 |
private byte[] | soundVersion2Data |
private com.coremedia.iso.BoxParser | boxParser |
Methods Summary |
---|
public void | _parseDetails(java.nio.ByteBuffer content)
_parseReservedAndDataReferenceIndex(content); //parses the six reserved bytes and dataReferenceIndex
// 8 bytes already parsed
//reserved bits - used by qt
soundVersion = IsoTypeReader.readUInt16(content);
//reserved
reserved1 = IsoTypeReader.readUInt16(content);
reserved2 = IsoTypeReader.readUInt32(content);
channelCount = IsoTypeReader.readUInt16(content);
sampleSize = IsoTypeReader.readUInt16(content);
//reserved bits - used by qt
compressionId = IsoTypeReader.readUInt16(content);
//reserved bits - used by qt
packetSize = IsoTypeReader.readUInt16(content);
//sampleRate = in.readFixedPoint1616();
sampleRate = IsoTypeReader.readUInt32(content);
if (!type.equals("mlpa")) {
sampleRate = sampleRate >>> 16;
}
//more qt stuff - see http://mp4v2.googlecode.com/svn-history/r388/trunk/src/atom_sound.cpp
if (soundVersion > 0) {
samplesPerPacket = IsoTypeReader.readUInt32(content);
bytesPerPacket = IsoTypeReader.readUInt32(content);
bytesPerFrame = IsoTypeReader.readUInt32(content);
bytesPerSample = IsoTypeReader.readUInt32(content);
}
if (soundVersion == 2) {
soundVersion2Data = new byte[20];
content.get(20);
}
_parseChildBoxes(content);
|
public long | getBytesPerFrame()
return bytesPerFrame;
|
public long | getBytesPerPacket()
return bytesPerPacket;
|
public long | getBytesPerSample()
return bytesPerSample;
|
public int | getChannelCount()
return channelCount;
|
public int | getCompressionId()
return compressionId;
|
protected void | getContent(java.nio.ByteBuffer byteBuffer)
_writeReservedAndDataReferenceIndex(byteBuffer);
IsoTypeWriter.writeUInt16(byteBuffer, soundVersion);
IsoTypeWriter.writeUInt16(byteBuffer, reserved1);
IsoTypeWriter.writeUInt32(byteBuffer, reserved2);
IsoTypeWriter.writeUInt16(byteBuffer, channelCount);
IsoTypeWriter.writeUInt16(byteBuffer, sampleSize);
IsoTypeWriter.writeUInt16(byteBuffer, compressionId);
IsoTypeWriter.writeUInt16(byteBuffer, packetSize);
//isos.writeFixedPoint1616(getSampleRate());
if (type.equals("mlpa")) {
IsoTypeWriter.writeUInt32(byteBuffer, getSampleRate());
} else {
IsoTypeWriter.writeUInt32(byteBuffer, getSampleRate() << 16);
}
if (soundVersion > 0) {
IsoTypeWriter.writeUInt32(byteBuffer, samplesPerPacket);
IsoTypeWriter.writeUInt32(byteBuffer, bytesPerPacket);
IsoTypeWriter.writeUInt32(byteBuffer, bytesPerFrame);
IsoTypeWriter.writeUInt32(byteBuffer, bytesPerSample);
}
if (soundVersion == 2) {
byteBuffer.put(soundVersion2Data);
}
_writeChildBoxes(byteBuffer);
|
protected long | getContentSize()
long contentSize = 28;
contentSize += soundVersion > 0 ? 16 : 0;
contentSize += soundVersion == 2 ? 20 : 0;
for (Box boxe : boxes) {
contentSize += boxe.getSize();
}
return contentSize;
|
public int | getPacketSize()
return packetSize;
|
public int | getReserved1()
return reserved1;
|
public long | getReserved2()
return reserved2;
|
public long | getSampleRate()
return sampleRate;
|
public int | getSampleSize()
return sampleSize;
|
public long | getSamplesPerPacket()
return samplesPerPacket;
|
public int | getSoundVersion()
return soundVersion;
|
public byte[] | getSoundVersion2Data()
return soundVersion2Data;
|
public void | setBoxParser(com.coremedia.iso.BoxParser boxParser)
this.boxParser = boxParser;
|
public void | setBytesPerFrame(long bytesPerFrame)
this.bytesPerFrame = bytesPerFrame;
|
public void | setBytesPerPacket(long bytesPerPacket)
this.bytesPerPacket = bytesPerPacket;
|
public void | setBytesPerSample(long bytesPerSample)
this.bytesPerSample = bytesPerSample;
|
public void | setChannelCount(int channelCount)
this.channelCount = channelCount;
|
public void | setCompressionId(int compressionId)
this.compressionId = compressionId;
|
public void | setPacketSize(int packetSize)
this.packetSize = packetSize;
|
public void | setReserved1(int reserved1)
this.reserved1 = reserved1;
|
public void | setReserved2(long reserved2)
this.reserved2 = reserved2;
|
public void | setSampleRate(long sampleRate)
this.sampleRate = sampleRate;
|
public void | setSampleSize(int sampleSize)
this.sampleSize = sampleSize;
|
public void | setSamplesPerPacket(long samplesPerPacket)
this.samplesPerPacket = samplesPerPacket;
|
public void | setSoundVersion(int soundVersion)
this.soundVersion = soundVersion;
|
public void | setSoundVersion2Data(byte[] soundVersion2Data)
this.soundVersion2Data = soundVersion2Data;
|
public java.lang.String | toString()
return "AudioSampleEntry{" +
"bytesPerSample=" + bytesPerSample +
", bytesPerFrame=" + bytesPerFrame +
", bytesPerPacket=" + bytesPerPacket +
", samplesPerPacket=" + samplesPerPacket +
", packetSize=" + packetSize +
", compressionId=" + compressionId +
", soundVersion=" + soundVersion +
", sampleRate=" + sampleRate +
", sampleSize=" + sampleSize +
", channelCount=" + channelCount +
", boxes=" + getBoxes() +
'}";
|