pub struct DefaultStreamValues(_);
Expand description

The default (optimal) audio streaming values.

On API 16 to 26 OpenSL ES will be used. When using OpenSL ES the optimal values for sample_rate and frames_per_burst 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 frames_per_burst from the HAL and will ignore this value.

Implementations

The default sample rate to use when opening new audio streams

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

The default channel count to use when opening new audio streams

Available on crate feature java-interface only.

Try request defaults from AudioManager properties.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Look up the concrete type from the JVM.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.