Package org.mp4parser.boxes.sampleentry
Class AudioSampleEntry
- java.lang.Object
-
- org.mp4parser.BasicContainer
-
- org.mp4parser.support.AbstractContainerBox
-
- org.mp4parser.boxes.sampleentry.AbstractSampleEntry
-
- org.mp4parser.boxes.sampleentry.AudioSampleEntry
-
- All Implemented Interfaces:
Box,SampleEntry,Container,ParsableBox
public final class AudioSampleEntry extends AbstractSampleEntry
4cc = ""samr"" || ""sawb" || ""mp4a" || ""drms" || ""alac" || ""owma" || ""ac-3" || ""ec-3" || ""mlpa" || ""dtsl" || ""dtsh" || ""dtse""
Contains basic information about the audio samples in this track. Format-specific information is appened as boxes after the data described in ISO/IEC 14496-12 chapter 8.16.2.
-
-
Field Summary
Fields Modifier and Type Field Description static StringTYPE_ENCRYPTEDIdentifier for an encrypted audio track.static StringTYPE1static StringTYPE10static StringTYPE11static StringTYPE12static StringTYPE13static StringTYPE2static StringTYPE3static StringTYPE4static StringTYPE5static StringTYPE7static StringTYPE8static StringTYPE9-
Fields inherited from class org.mp4parser.boxes.sampleentry.AbstractSampleEntry
dataReferenceIndex
-
Fields inherited from class org.mp4parser.support.AbstractContainerBox
largeBox, type
-
-
Constructor Summary
Constructors Constructor Description AudioSampleEntry(String type)
-
Method Summary
Modifier and Type Method Description booleanequals(Object o)voidgetBox(WritableByteChannel writableByteChannel)Writes the complete box - size | 4-cc | content - to the givenwritableByteChannel.longgetBytesPerFrame()longgetBytesPerPacket()longgetBytesPerSample()intgetChannelCount()intgetCompressionId()intgetPacketSize()intgetReserved1()longgetReserved2()longgetSampleRate()intgetSampleSize()longgetSamplesPerPacket()longgetSize()intgetSoundVersion()byte[]getSoundVersion2Data()inthashCode()voidparse(ReadableByteChannel dataSource, ByteBuffer header, long contentSize, BoxParser boxParser)Parses the box excluding the already parsed header (size, 4cc, [long-size], [user-type]).voidsetBytesPerFrame(long bytesPerFrame)voidsetBytesPerPacket(long bytesPerPacket)voidsetBytesPerSample(long bytesPerSample)voidsetChannelCount(int channelCount)voidsetCompressionId(int compressionId)voidsetPacketSize(int packetSize)voidsetReserved1(int reserved1)voidsetReserved2(long reserved2)voidsetSampleRate(long sampleRate)voidsetSampleSize(int sampleSize)voidsetSamplesPerPacket(long samplesPerPacket)voidsetSoundVersion(int soundVersion)voidsetSoundVersion2Data(byte[] soundVersion2Data)voidsetType(String type)StringtoString()-
Methods inherited from class org.mp4parser.boxes.sampleentry.AbstractSampleEntry
getDataReferenceIndex, setDataReferenceIndex
-
Methods inherited from class org.mp4parser.support.AbstractContainerBox
getHeader, getType, setParent
-
Methods inherited from class org.mp4parser.BasicContainer
addBox, getBoxes, getBoxes, getBoxes, getContainerSize, initContainer, setBoxes, writeContainer
-
-
-
-
Field Detail
-
TYPE1
public static final String TYPE1
- See Also:
- Constant Field Values
-
TYPE2
public static final String TYPE2
- See Also:
- Constant Field Values
-
TYPE3
public static final String TYPE3
- See Also:
- Constant Field Values
-
TYPE4
public static final String TYPE4
- See Also:
- Constant Field Values
-
TYPE5
public static final String TYPE5
- See Also:
- Constant Field Values
-
TYPE7
public static final String TYPE7
- See Also:
- Constant Field Values
-
TYPE8
public static final String TYPE8
- See Also:
- Constant Field Values
-
TYPE9
public static final String TYPE9
- See Also:
- Constant Field Values
-
TYPE10
public static final String TYPE10
- See Also:
- Constant Field Values
-
TYPE11
public static final String TYPE11
- See Also:
- Constant Field Values
-
TYPE12
public static final String TYPE12
- See Also:
- Constant Field Values
-
TYPE13
public static final String TYPE13
- See Also:
- Constant Field Values
-
TYPE_ENCRYPTED
public static final String TYPE_ENCRYPTED
Identifier for an encrypted audio track.
-
-
Constructor Detail
-
AudioSampleEntry
public AudioSampleEntry(String type)
-
-
Method Detail
-
setType
public void setType(String type)
-
getChannelCount
public int getChannelCount()
-
setChannelCount
public void setChannelCount(int channelCount)
-
getSampleSize
public int getSampleSize()
-
setSampleSize
public void setSampleSize(int sampleSize)
-
getSampleRate
public long getSampleRate()
-
setSampleRate
public void setSampleRate(long sampleRate)
-
getSoundVersion
public int getSoundVersion()
-
setSoundVersion
public void setSoundVersion(int soundVersion)
-
getCompressionId
public int getCompressionId()
-
setCompressionId
public void setCompressionId(int compressionId)
-
getPacketSize
public int getPacketSize()
-
setPacketSize
public void setPacketSize(int packetSize)
-
getSamplesPerPacket
public long getSamplesPerPacket()
-
setSamplesPerPacket
public void setSamplesPerPacket(long samplesPerPacket)
-
getBytesPerPacket
public long getBytesPerPacket()
-
setBytesPerPacket
public void setBytesPerPacket(long bytesPerPacket)
-
getBytesPerFrame
public long getBytesPerFrame()
-
setBytesPerFrame
public void setBytesPerFrame(long bytesPerFrame)
-
getBytesPerSample
public long getBytesPerSample()
-
setBytesPerSample
public void setBytesPerSample(long bytesPerSample)
-
getSoundVersion2Data
public byte[] getSoundVersion2Data()
-
setSoundVersion2Data
public void setSoundVersion2Data(byte[] soundVersion2Data)
-
getReserved1
public int getReserved1()
-
setReserved1
public void setReserved1(int reserved1)
-
getReserved2
public long getReserved2()
-
setReserved2
public void setReserved2(long reserved2)
-
parse
public void parse(ReadableByteChannel dataSource, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException
Description copied from interface:ParsableBoxParses the box excluding the already parsed header (size, 4cc, [long-size], [user-type]). The remaining size of the box is thecontentSize,contentSizenumber of bytes should be read from the box source (readableByteChannel). If you need theheaderbuffer at a later stage you have to create a copy.- Specified by:
parsein interfaceParsableBox- Specified by:
parsein classAbstractSampleEntry- Parameters:
dataSource- the source for this boxheader- the box' already parsed header (create copy if you need it later as it will be overwritten)contentSize- remaining bytes of this boxboxParser- use it to parse sub-boxes.- Throws:
IOException- in case of an error during a read operation
-
getBox
public void getBox(WritableByteChannel writableByteChannel) throws IOException
Description copied from interface:BoxWrites the complete box - size | 4-cc | content - to the givenwritableByteChannel.- Specified by:
getBoxin interfaceBox- Specified by:
getBoxin classAbstractSampleEntry- Parameters:
writableByteChannel- the box's sink- Throws:
IOException- in case of problems with theChannel
-
getSize
public long getSize()
- Specified by:
getSizein interfaceBox- Overrides:
getSizein classAbstractContainerBox
-
toString
public String toString()
- Overrides:
toStringin classBasicContainer
-
-