Oboe
A library for creating real-time audio apps on Android
|
#include <Definitions.h>
Static Public Attributes | |
static int32_t | SampleRate |
static int32_t | FramesPerBurst |
static int32_t | ChannelCount |
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.
|
static |
The default channel count to use when opening new audio streams
|
static |
The default frames per burst to use when opening new audio streams
|
static |
The default sample rate to use when opening new audio streams