Class 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 Details

  • Constructor Details

    • AudioSampleEntry

      public AudioSampleEntry(String type)
  • Method Details

    • 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: ParsableBox
      Parses the box excluding the already parsed header (size, 4cc, [long-size], [user-type]). The remaining size of the box is the contentSize, contentSize number of bytes should be read from the box source (readableByteChannel). If you need the header buffer at a later stage you have to create a copy.
      Specified by:
      parse in interface ParsableBox
      Specified by:
      parse in class AbstractSampleEntry
      Parameters:
      dataSource - the source for this box
      header - the box' already parsed header (create copy if you need it later as it will be overwritten)
      contentSize - remaining bytes of this box
      boxParser - 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: Box
      Writes the complete box - size | 4-cc | content - to the given writableByteChannel.
      Specified by:
      getBox in interface Box
      Specified by:
      getBox in class AbstractSampleEntry
      Parameters:
      writableByteChannel - the box's sink
      Throws:
      IOException - in case of problems with the Channel
    • getSize

      public long getSize()
      Specified by:
      getSize in interface Box
      Overrides:
      getSize in class AbstractContainerBox
    • toString

      public String toString()
      Overrides:
      toString in class BasicContainer
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object