Oboe 1.5 A library for creating real-time audio apps on Android

Static Public Attributes | List of all members
oboe::DefaultStreamValues Class Reference

`#include <Definitions.h>`

## Static Public Attributes
static int32_t | SampleRate
static int32_t | FramesPerBurst
static int32_t | ChannelCount

## Detailed Description

On API 16 to 26 OpenSL ES will be used. When using OpenSL ES the optimal values for sampleRate and framesPerBurst are not known by the native code. On API 17+ these values should be obtained from the AudioManager using this code:

    // Note that this technique only works for built-in speakers and headphones.
    AudioManager myAudioMgr = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
    String sampleRateStr = myAudioMgr.getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE);
    int defaultSampleRate = Integer.parseInt(sampleRateStr);
    String framesPerBurstStr = myAudioMgr.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER);
    int defaultFramesPerBurst = Integer.parseInt(framesPerBurstStr);

It can then be passed down to Oboe through JNI.

AAudio will get the optimal framesPerBurst from the HAL and will ignore this value.

## Member Data Documentation

## ◆ ChannelCount

int32_t oboe::DefaultStreamValues::ChannelCount
| static

The default channel count to use when opening new audio streams

## ◆ FramesPerBurst

int32_t oboe::DefaultStreamValues::FramesPerBurst
| static

The default frames per burst to use when opening new audio streams

## ◆ SampleRate

int32_t oboe::DefaultStreamValues::SampleRate
| static

The default sample rate to use when opening new audio streams

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

- include/oboe/Definitions.h