Class AudioStream
- java.lang.Object
-
- org.schabi.newpipe.extractor.stream.Stream
-
- org.schabi.newpipe.extractor.stream.AudioStream
-
- All Implemented Interfaces:
java.io.Serializable
public final class AudioStream extends Stream
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AudioStream.Builder
Class to buildAudioStream
objects.
-
Field Summary
Fields Modifier and Type Field Description static int
UNKNOWN_BITRATE
-
Fields inherited from class org.schabi.newpipe.extractor.stream.Stream
FORMAT_ID_UNKNOWN, ID_UNKNOWN, ITAG_NOT_AVAILABLE_OR_NOT_APPLICABLE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equalStats(Stream cmp)
Reveals whether two streams have the same statistics (media format
anddelivery method
).java.util.Locale
getAudioLocale()
Get theLocale
of the audio representing the language of the stream, which isnull
if the audio language of this stream is not known.java.lang.String
getAudioTrackId()
Get the id of the audio track.java.lang.String
getAudioTrackName()
Get the name of the audio track, which may benull
if this information is not provided by the service.AudioTrackType
getAudioTrackType()
Get theAudioTrackType
of the stream, which isnull
if the track type is not known.int
getAverageBitrate()
Get the average bitrate of the stream.int
getBitrate()
Get the bitrate of the stream.java.lang.String
getCodec()
Get the codec of the stream.int
getIndexEnd()
Get the index end of the stream.int
getIndexStart()
Get the index start of the stream.int
getInitEnd()
Get the initialization end of the stream.int
getInitStart()
Get the initialization start of the stream.int
getItag()
Get the itag identifier of the stream.ItagItem
getItagItem()
Gets theItagItem
of a stream.java.lang.String
getQuality()
Get the quality of the stream.-
Methods inherited from class org.schabi.newpipe.extractor.stream.Stream
containSimilarStream, getContent, getDeliveryMethod, getFormat, getFormatId, getId, getManifestUrl, getUrl, isUrl
-
-
-
-
Field Detail
-
UNKNOWN_BITRATE
public static final int UNKNOWN_BITRATE
- See Also:
- Constant Field Values
-
-
Method Detail
-
equalStats
public boolean equalStats(Stream cmp)
Reveals whether two streams have the same statistics (media format
anddelivery method
).If the
media format
of the stream is unknown, the streams are compared by using only thedelivery method
and their ID.Note: This method always returns false if the stream passed is null.
- Overrides:
equalStats
in classStream
- Parameters:
cmp
- the stream object to be compared to this stream object- Returns:
- whether the stream have the same stats or not, based on the criteria above
-
getAverageBitrate
public int getAverageBitrate()
Get the average bitrate of the stream.- Returns:
- the average bitrate or
UNKNOWN_BITRATE
if it is unknown
-
getItag
public int getItag()
Get the itag identifier of the stream.Always equals to
Stream.ITAG_NOT_AVAILABLE_OR_NOT_APPLICABLE
for other streams than the ones of the YouTube service.- Returns:
- the number of the
ItagItem
passed in the constructor of the audio stream.
-
getBitrate
public int getBitrate()
Get the bitrate of the stream.- Returns:
- the bitrate set from the
ItagItem
passed in the constructor of the stream.
-
getInitStart
public int getInitStart()
Get the initialization start of the stream.- Returns:
- the initialization start value set from the
ItagItem
passed in the constructor of the stream.
-
getInitEnd
public int getInitEnd()
Get the initialization end of the stream.- Returns:
- the initialization end value set from the
ItagItem
passed in the constructor of the stream.
-
getIndexStart
public int getIndexStart()
Get the index start of the stream.- Returns:
- the index start value set from the
ItagItem
passed in the constructor of the stream.
-
getIndexEnd
public int getIndexEnd()
Get the index end of the stream.- Returns:
- the index end value set from the
ItagItem
passed in the constructor of the stream.
-
getQuality
public java.lang.String getQuality()
Get the quality of the stream.- Returns:
- the quality label set from the
ItagItem
passed in the constructor of the stream.
-
getCodec
public java.lang.String getCodec()
Get the codec of the stream.- Returns:
- the codec set from the
ItagItem
passed in the constructor of the stream.
-
getAudioTrackId
@Nullable public java.lang.String getAudioTrackId()
Get the id of the audio track.- Returns:
- the id of the audio track
-
getAudioTrackName
@Nullable public java.lang.String getAudioTrackName()
Get the name of the audio track, which may benull
if this information is not provided by the service.- Returns:
- the name of the audio track or
null
-
getAudioLocale
@Nullable public java.util.Locale getAudioLocale()
Get theLocale
of the audio representing the language of the stream, which isnull
if the audio language of this stream is not known.- Returns:
- the
Locale
of the audio ornull
-
getAudioTrackType
@Nullable public AudioTrackType getAudioTrackType()
Get theAudioTrackType
of the stream, which isnull
if the track type is not known.- Returns:
- the
AudioTrackType
of the stream ornull
-
getItagItem
@Nullable public ItagItem getItagItem()
Gets theItagItem
of a stream.If the stream is not from YouTube, this value will always be null.
- Specified by:
getItagItem
in classStream
- Returns:
- the
ItagItem
of the stream ornull
-
-