public final class AudioStreamInfo extends Object
This class provides initialized parameters of AudioCapturer and AudioRenderer,
including the stream encoding format, sampling rate, audio channel, usage type, content type, session ID,
buffer size, clearing flag, audio source, and stream flags.
SystemCapability.Multimedia#AUDIO| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
AudioStreamInfo.AudioStreamFlag |
Describes audio stream flags.
|
static class |
AudioStreamInfo.Builder |
Provides builders for
AudioStreamInfo objects. |
static class |
AudioStreamInfo.ChannelMask |
Describes the channel mask.
|
static class |
AudioStreamInfo.ContentType |
Describes types of audio stream content.
|
static class |
AudioStreamInfo.EncodingFormat |
Describes the stream encoding format.
|
static class |
AudioStreamInfo.StreamType |
Describes audio stream type.
|
static class |
AudioStreamInfo.StreamUsage |
Indicates the audio stream usage type.
|
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
SAMPLE_RATE_FOR_DIRECT_HZ_MAX |
Indicates the maximum sampling rate (in Hz) for
AudioRendererInfo.AudioStreamOutputFlag#AUDIO_STREAM_OUTPUT_FLAG_DIRECT. |
static int |
SAMPLE_RATE_HZ_MAX |
Indicates the maximum sampling rate (in Hz).
|
static int |
SAMPLE_RATE_HZ_MIN |
Indicates the minimum sampling rate (in Hz).
|
static int |
SAMPLE_RATE_UNSPECIFIED |
Indicates the initial sampling rate.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
AudioStreamInfo.AudioStreamFlag |
getAudioStreamFlag() |
Obtains the audio stream flag.
|
static int |
getChannelCount(AudioStreamInfo.ChannelMask mask) |
Obtains the number of audio channels contained in the specified audio channel mask.
|
AudioStreamInfo.ChannelMask |
getChannelMask() |
Obtains the channel mask of the audio stream.
|
AudioStreamInfo.ContentType |
getContentType() |
Obtains the content type of the audio stream.
|
AudioStreamInfo.EncodingFormat |
getEncodingFormat() |
Obtains the encoding format of the audio stream.
|
int |
getSampleRate() |
Obtains the sampling rate of the audio stream.
|
AudioStreamInfo.StreamType |
getStreamType() |
Obtains the audio stream type.
|
AudioStreamInfo.StreamUsage |
getUsage() |
Obtains the usage type of the audio stream.
|
static boolean |
isValidEncodingFormat(AudioStreamInfo.EncodingFormat format) |
Checks whether an encoding format is valid.
|
static boolean |
isValidOutChannelMask(AudioStreamInfo.ChannelMask channelMask) |
Checks whether the audio channel mask is valid.
|
String |
toString() |
Obtains the string representation of the
AudioStreamInfo object. |
public static final int SAMPLE_RATE_FOR_DIRECT_HZ_MAX
AudioRendererInfo.AudioStreamOutputFlag#AUDIO_STREAM_OUTPUT_FLAG_DIRECT.public static final int SAMPLE_RATE_HZ_MAX
public static final int SAMPLE_RATE_HZ_MIN
public static final int SAMPLE_RATE_UNSPECIFIED
public AudioStreamInfo.EncodingFormat getEncodingFormat()
EncodingFormat.public int getSampleRate()
public AudioStreamInfo.ChannelMask getChannelMask()
ChannelMask.public AudioStreamInfo.StreamUsage getUsage()
StreamUsage.public AudioStreamInfo.StreamType getStreamType()
StreamType.public AudioStreamInfo.ContentType getContentType()
ContentType.public AudioStreamInfo.AudioStreamFlag getAudioStreamFlag()
AudioStreamFlag.public String toString()
AudioStreamInfo object.public static boolean isValidEncodingFormat(AudioStreamInfo.EncodingFormat format)
format - Indicates the EncodingFormat to check.true if the encoding format is valid; returns false otherwise.public static boolean isValidOutChannelMask(AudioStreamInfo.ChannelMask channelMask)
channelMask - Indicates the audio ChannelMask to check.true if the audio channel mask is valid; returns false otherwise.public static int getChannelCount(AudioStreamInfo.ChannelMask mask)
mask - Indicates the audio ChannelMask.