Record Class FfmpegMedia.AudioTrack

java.lang.Object
java.lang.Record
limn.video.ffmpeg.FfmpegMedia.AudioTrack
Record Components:
index - this track's position in FfmpegMedia.audioTracks(), and what FfmpegMedia.audio(int) takes. Not a container stream index: a file whose audio is streams 1 and 2 has tracks 0 and 1
streamIndex - the container's own index for this stream, for a diagnostic; nothing in this API takes it
channels - what this track would deliver: 1 or 2, after the fold the audio engine makes necessary
sourceChannels - what the file holds, before that fold. A 5.1 track reports 6 here and 2 in channels
sampleRate - frames a second, as the file declares it. Nothing resamples, so this is what the engine would be handed
codec - the codec's name as libavcodec spells it: aac, opus
language - the language tag the container states, or null when it states none. Null and never an empty string, so that a caller can tell the two apart rather than rendering a blank row; the tag is whatever the container carries, which for MP4 and Matroska is an ISO 639-2 three-letter code, and the undetermined code und is reported as null because it is the file saying it does not know
isDefault - whether this is the track FfmpegMedia.audio() hands over (the container's own signalling, ranked as libavformat ranks it: the default disposition first, then channel count and bit rate)
decodable - whether this build has a decoder for it. False is not a broken file: a trimmed build carries a few codecs, and a track it cannot decode is still listed rather than hidden, because a two-language film with one playable track is not a one-language film. Asking for such a track throws rather than playing silence
Enclosing class:
FfmpegMedia

public static record FfmpegMedia.AudioTrack(int index, int streamIndex, int channels, int sourceChannels, int sampleRate, String codec, String language, boolean isDefault, boolean decodable) extends Record
One of a container's audio tracks, as the container describes it: read once at open, from the file's own stream headers, without opening a decoder for it.
  • Constructor Details

    • AudioTrack

      public AudioTrack(int index, int streamIndex, int channels, int sourceChannels, int sampleRate, String codec, String language, boolean isDefault, boolean decodable)
      Creates an instance of a AudioTrack record class.
      Parameters:
      index - the value for the index record component
      streamIndex - the value for the streamIndex record component
      channels - the value for the channels record component
      sourceChannels - the value for the sourceChannels record component
      sampleRate - the value for the sampleRate record component
      codec - the value for the codec record component
      language - the value for the language record component
      isDefault - the value for the isDefault record component
      decodable - the value for the decodable record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component
    • streamIndex

      public int streamIndex()
      Returns the value of the streamIndex record component.
      Returns:
      the value of the streamIndex record component
    • channels

      public int channels()
      Returns the value of the channels record component.
      Returns:
      the value of the channels record component
    • sourceChannels

      public int sourceChannels()
      Returns the value of the sourceChannels record component.
      Returns:
      the value of the sourceChannels record component
    • sampleRate

      public int sampleRate()
      Returns the value of the sampleRate record component.
      Returns:
      the value of the sampleRate record component
    • codec

      public String codec()
      Returns the value of the codec record component.
      Returns:
      the value of the codec record component
    • language

      public String language()
      Returns the value of the language record component.
      Returns:
      the value of the language record component
    • isDefault

      public boolean isDefault()
      Returns the value of the isDefault record component.
      Returns:
      the value of the isDefault record component
    • decodable

      public boolean decodable()
      Returns the value of the decodable record component.
      Returns:
      the value of the decodable record component