# Oboe: oboe::AudioStreamBase Class Reference

oboe::AudioStreamBase Class Reference

`#include <AudioStreamBase.h>`

Inheritance diagram for oboe::AudioStreamBase:

## Public Member Functions

| AudioStreamBase (const AudioStreamBase &)=default
AudioStreamBase & | operator= (const AudioStreamBase &)=default
int32_t | getChannelCount () const
Direction | getDirection () const
int32_t | getSampleRate () const
int32_t | getFramesPerCallback () const
AudioFormat | getFormat () const
virtual int32_t | getBufferSizeInFrames ()
virtual int32_t | getBufferCapacityInFrames () const
SharingMode | getSharingMode () const
PerformanceMode | getPerformanceMode () const
int32_t | getDeviceId () const
AudioStreamCallback * | getCallback () const
Usage | getUsage () const
ContentType | getContentType () const
InputPreset | getInputPreset () const
SessionId | getSessionId () const
bool | isChannelConversionAllowed () const
bool | isFormatConversionAllowed () const
SampleRateConversionQuality | getSampleRateConversionQuality () const

## Protected Attributes

AudioStreamCallback * | mStreamCallback = nullptr
int32_t | mFramesPerCallback = kUnspecified
int32_t | mChannelCount = kUnspecified
int32_t | mSampleRate = kUnspecified
int32_t | mDeviceId = kUnspecified
int32_t | mBufferCapacityInFrames = kUnspecified
int32_t | mBufferSizeInFrames = kUnspecified
int32_t | mFramesPerBurst = kUnspecified
SharingMode | mSharingMode = SharingMode::Shared
AudioFormat | mFormat = AudioFormat::Unspecified
Direction | mDirection = Direction::Output
PerformanceMode | mPerformanceMode = PerformanceMode::None
Usage | mUsage = Usage::Media
ContentType | mContentType = ContentType::Music
InputPreset | mInputPreset = InputPreset::VoiceRecognition
SessionId | mSessionId = SessionId::None
bool | mChannelConversionAllowed = false
bool | mFormatConversionAllowed = false
SampleRateConversionQuality | mSampleRateConversionQuality = SampleRateConversionQuality::None

## Detailed Description

Base class containing parameters for audio streams and builders.

## Constructor & Destructor Documentation

## AudioStreamBase()

oboe::AudioStreamBase::AudioStreamBase | ( | const AudioStreamBase & |  | ) |

default

Default copy constructor

## Member Function Documentation

## getBufferCapacityInFrames()

virtual int32_t oboe::AudioStreamBase::getBufferCapacityInFrames | ( |  | ) | const

inlinevirtual

Returns
  capacityInFrames or kUnspecified

## getBufferSizeInFrames()

virtual int32_t oboe::AudioStreamBase::getBufferSizeInFrames | ( |  | ) |

inlinevirtual

Query the maximum number of frames that can be filled without blocking. If the stream has been closed the last known value will be returned.

Returns
  buffer size

## getCallback()

AudioStreamCallback* oboe::AudioStreamBase::getCallback | ( |  | ) | const

inline

Returns
  the callback object for this stream, if set.

## getChannelCount()

int32_t oboe::AudioStreamBase::getChannelCount | ( |  | ) | const

inline

Returns
  number of channels, for example 2 for stereo, or kUnspecified

## getContentType()

ContentType oboe::AudioStreamBase::getContentType | ( |  | ) | const

inline

Returns
  the stream's content type.

## getDeviceId()

int32_t oboe::AudioStreamBase::getDeviceId | ( |  | ) | const

inline

Returns
  the device ID of the stream.

## getDirection()

Direction oboe::AudioStreamBase::getDirection | ( |  | ) | const

inline

Returns
  Direction::Input or Direction::Output

## getFormat()

AudioFormat oboe::AudioStreamBase::getFormat | ( |  | ) | const

inline

Returns
  the audio sample format (e.g. Float or I16)

## getFramesPerCallback()

int32_t oboe::AudioStreamBase::getFramesPerCallback | ( |  | ) | const

inline

Returns
  the number of frames in each callback or kUnspecified.

## getInputPreset()

InputPreset oboe::AudioStreamBase::getInputPreset | ( |  | ) | const

inline

Returns
  the stream's input preset.

## getPerformanceMode()

PerformanceMode oboe::AudioStreamBase::getPerformanceMode | ( |  | ) | const

inline

Returns
  the performance mode of the stream.

## getSampleRate()

int32_t oboe::AudioStreamBase::getSampleRate | ( |  | ) | const

inline

Returns
  sample rate for the stream or kUnspecified

## getSampleRateConversionQuality()

SampleRateConversionQuality oboe::AudioStreamBase::getSampleRateConversionQuality | ( |  | ) | const

inline

Returns
  whether and how Oboe can convert sample rates to achieve optimal results.

## getSessionId()

SessionId oboe::AudioStreamBase::getSessionId | ( |  | ) | const

inline

Returns
  the stream's session ID allocation strategy (None or Allocate).

## getSharingMode()

SharingMode oboe::AudioStreamBase::getSharingMode | ( |  | ) | const

inline

Returns
  the sharing mode of the stream.

## getUsage()

Usage oboe::AudioStreamBase::getUsage | ( |  | ) | const

inline

Returns
  the usage for this stream.

## isChannelConversionAllowed()

bool oboe::AudioStreamBase::isChannelConversionAllowed | ( |  | ) | const

inline

Returns
  true if Oboe can convert channel counts to achieve optimal results.

## isFormatConversionAllowed()

bool oboe::AudioStreamBase::isFormatConversionAllowed | ( |  | ) | const

inline

Returns
  true if Oboe can convert data formats to achieve optimal results.

## operator=()

AudioStreamBase& oboe::AudioStreamBase::operator= | ( | const AudioStreamBase & |  | ) |

default

Default assignment operator

## Member Data Documentation

## mBufferCapacityInFrames

int32_t oboe::AudioStreamBase::mBufferCapacityInFrames = kUnspecified

protected

Stream buffer capacity specified as a number of audio frames

## mBufferSizeInFrames

int32_t oboe::AudioStreamBase::mBufferSizeInFrames = kUnspecified

protected

Stream buffer size specified as a number of audio frames

## mChannelCount

int32_t oboe::AudioStreamBase::mChannelCount = kUnspecified

protected

Stream channel count

## mContentType

ContentType oboe::AudioStreamBase::mContentType = ContentType::Music

protected

Stream content type. Only active on Android 28+

## mDeviceId

int32_t oboe::AudioStreamBase::mDeviceId = kUnspecified

protected

Stream audio device ID

## mDirection

Direction oboe::AudioStreamBase::mDirection = Direction::Output

protected

Stream direction

## mFormat

AudioFormat oboe::AudioStreamBase::mFormat = AudioFormat::Unspecified

protected

Format of audio frames

## mFramesPerBurst

int32_t oboe::AudioStreamBase::mFramesPerBurst = kUnspecified

protected

Number of frames which will be copied to/from the audio device in a single read/write operation

## mFramesPerCallback

int32_t oboe::AudioStreamBase::mFramesPerCallback = kUnspecified

protected

Number of audio frames which will be requested in each callback

## mInputPreset

InputPreset oboe::AudioStreamBase::mInputPreset = InputPreset::VoiceRecognition

protected

Stream input preset. Only active on Android 28+ TODO InputPreset::Unspecified should be considered as a possible default alternative.

## mPerformanceMode

PerformanceMode oboe::AudioStreamBase::mPerformanceMode = PerformanceMode::None

protected

Stream performance mode

## mSampleRate

int32_t oboe::AudioStreamBase::mSampleRate = kUnspecified

protected

Stream sample rate

## mSessionId

SessionId oboe::AudioStreamBase::mSessionId = SessionId::None

protected

Stream session ID allocation strategy. Only active on Android 28+

## mSharingMode

SharingMode oboe::AudioStreamBase::mSharingMode = SharingMode::Shared

protected

Stream sharing mode

## mStreamCallback

AudioStreamCallback* oboe::AudioStreamBase::mStreamCallback = nullptr

protected

The callback which will be fired when new data is ready to be read/written

## mUsage

Usage oboe::AudioStreamBase::mUsage = Usage::Media

protected

Stream usage. Only active on Android 28+

The documentation for this class was generated from the following file:

- include/oboe/AudioStreamBase.h