Expand description
§Raw (unsafe) bindings for Oboe library
Oboe is a C++ library which makes it easy to build high-performance audio apps on Android. It was created primarily to allow developers to target a simplified API that works across multiple API levels back to API level 16 (Jelly Bean).
Usually you shouldn’t use this crate directly, instead use oboe crate which provides safe interface.
Structs§
- oboe_
Audio Stream - Base class for Oboe C++ audio stream.
- oboe_
Audio Stream Base - Base class containing parameters for audio streams and builders.
- oboe_
Audio Stream Base__ bindgen_ vtable - oboe_
Audio Stream Builder - Factory class for an audio Stream.
- oboe_
Audio Stream Callback - AudioStreamCallback defines a callback interface for:
- oboe_
Audio Stream Callback Wrapper - oboe_
Audio Stream Data Callback - AudioStreamDataCallback defines a callback interface for
moving data to/from an audio stream using
onAudioReady
2) being alerted when a stream has an error usingonError*
methods - oboe_
Audio Stream Data Callback__ bindgen_ vtable - oboe_
Audio Stream Error Callback - AudioStreamErrorCallback defines a callback interface for
being alerted when a stream has an error or is disconnected
using
onError*
methods. - oboe_
Audio Stream Error Callback__ bindgen_ vtable - oboe_
Default Stream Values - 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:
- oboe_
Frame Timestamp - The time at which the frame at
position
was presented - oboe_
Latency Tuner - LatencyTuner can be used to dynamically tune the latency of an output stream. It adjusts the stream’s bufferSize by monitoring the number of underruns.
- oboe_
Result With Value - A ResultWithValue can store both the result of an operation (either OK or an error) and a value.
- oboe_
Stabilized Callback - oboe_
Stream Deleter Functor - This struct is a stateless functor which closes an AudioStream prior to its deletion. This means it can be used to safely delete a smart pointer referring to an open stream.
- oboe_
Version - Oboe versioning object
Constants§
- oboe_
Allowed Capture Policy_ All - Indicates that the audio may be captured by any app.
- oboe_
Allowed Capture Policy_ None - Indicates that the audio may not be recorded by any app, even if it is a system app.
- oboe_
Allowed Capture Policy_ System - Indicates that the audio may only be captured by system apps.
- oboe_
Allowed Capture Policy_ Unspecified - When not explicitly requested, set privacy sensitive mode according to the Usage. This should behave similarly to setting AllowedCapturePolicy::All.
- oboe_
Audio Api_ AAudio - Try to use AAudio. Fail if unavailable. AAudio was first supported in Android 8, API 26 and above. It is only recommended for API 27 and above.
- oboe_
Audio Api_ OpenSLES - Use OpenSL ES. Note that OpenSL ES is deprecated in Android 13, API 30 and above.
- oboe_
Audio Api_ Unspecified - Try to use AAudio. If not available then use OpenSL ES.
- oboe_
Audio Format_ Float - Single precision floating point.
- oboe_
Audio Format_ I16 - Signed 16-bit integers.
- oboe_
Audio Format_ I24 - Signed 24-bit integers, packed into 3 bytes.
- oboe_
Audio Format_ I32 - Signed 32-bit integers.
- oboe_
Audio Format_ IEC61937 - This format is used for compressed audio wrapped in IEC61937 for HDMI or S/PDIF passthrough.
- oboe_
Audio Format_ Invalid - Invalid format.
- oboe_
Audio Format_ Unspecified - Unspecified format. Format will be decided by Oboe. When calling getHardwareFormat(), this will be returned if the API is not supported.
- oboe_
Audio Stream_ kMin Delay Before Close Millis - oboe_
Channel Count_ Mono - Use this for mono audio
- oboe_
Channel Count_ Stereo - Use this for stereo audio.
- oboe_
Channel Count_ Unspecified - Audio channel count definition, use Mono or Stereo
- oboe_
Channel Mask_ Back Center - oboe_
Channel Mask_ Back Left - oboe_
Channel Mask_ Back Right - oboe_
Channel Mask_ Bottom Front Center - oboe_
Channel Mask_ Bottom Front Left - oboe_
Channel Mask_ Bottom Front Right - oboe_
Channel Mask_ CM2Point0 Point2 - Supported for Input and Output
- oboe_
Channel Mask_ CM2Point1 - Supported for only Output
- oboe_
Channel Mask_ CM2Point1 Point2 - Supported for Input and Output
- oboe_
Channel Mask_ CM3Point0 Point2 - Supported for Input and Output
- oboe_
Channel Mask_ CM3Point1 - Supported for only Output
- oboe_
Channel Mask_ CM3Point1 Point2 - Supported for Input and Output
- oboe_
Channel Mask_ CM5Point1 - Supported for Input and Output. aka 5Point1Back
- oboe_
Channel Mask_ CM5Point1 Point2 - Supported for only Output
- oboe_
Channel Mask_ CM5Point1 Point4 - Supported for only Output
- oboe_
Channel Mask_ CM5Point1 Side - Supported for only Output
- oboe_
Channel Mask_ CM6Point1 - Supported for only Output
- oboe_
Channel Mask_ CM7Point1 - Supported for only Output
- oboe_
Channel Mask_ CM7Point1 Point2 - Supported for only Output
- oboe_
Channel Mask_ CM7Point1 Point4 - Supported for only Output
- oboe_
Channel Mask_ CM9Point1 Point4 - Supported for only Output
- oboe_
Channel Mask_ CM9Point1 Point6 - Supported for only Output
- oboe_
Channel Mask_ Front Back - Supported for only Input
- oboe_
Channel Mask_ Front Center - oboe_
Channel Mask_ Front Left - oboe_
Channel Mask_ Front Left OfCenter - oboe_
Channel Mask_ Front Right - oboe_
Channel Mask_ Front Right OfCenter - oboe_
Channel Mask_ Front Wide Left - oboe_
Channel Mask_ Front Wide Right - oboe_
Channel Mask_ LowFrequency - oboe_
Channel Mask_ LowFrequency2 - oboe_
Channel Mask_ Mono - Supported for Input and Output
- oboe_
Channel Mask_ Penta - Supported for only Output
- oboe_
Channel Mask_ Quad - Supported for only Output
- oboe_
Channel Mask_ Quad Side - Supported for only Output
- oboe_
Channel Mask_ Side Left - oboe_
Channel Mask_ Side Right - oboe_
Channel Mask_ Stereo - Supported for Input and Output
- oboe_
Channel Mask_ Surround - Supported for only Output
- oboe_
Channel Mask_ TopBack Center - oboe_
Channel Mask_ TopBack Left - oboe_
Channel Mask_ TopBack Right - oboe_
Channel Mask_ TopCenter - oboe_
Channel Mask_ TopFront Center - oboe_
Channel Mask_ TopFront Left - oboe_
Channel Mask_ TopFront Right - oboe_
Channel Mask_ TopSide Left - oboe_
Channel Mask_ TopSide Right - oboe_
Channel Mask_ Tri - Supported for only Output
- oboe_
Channel Mask_ TriBack - Supported for only Output
- oboe_
Channel Mask_ Unspecified - oboe_
Content Type_ Movie - Use this for a movie or video soundtrack.
- oboe_
Content Type_ Music - Use this for pre-recorded or live music.
- oboe_
Content Type_ Sonification - Use this for sound is designed to accompany a user action, such as a click or beep sound made when the user presses a button.
- oboe_
Content Type_ Speech - Use this for spoken voice, audio books, etcetera.
- oboe_
Data Callback Result_ Continue - oboe_
Data Callback Result_ Stop - oboe_
Direction_ Input - Used for recording.
- oboe_
Direction_ Output - Used for playback.
- oboe_
Input Preset_ Camcorder - Use this preset when recording video.
- oboe_
Input Preset_ Generic - Use this preset when other presets do not apply.
- oboe_
Input Preset_ Unprocessed - Use this preset to obtain an input with no effects. Note that this input will not have automatic gain control so the recorded volume may be very low.
- oboe_
Input Preset_ Voice Communication - Use this preset when doing telephony or voice messaging.
- oboe_
Input Preset_ Voice Performance - Use this preset for capturing audio meant to be processed in real time and played back for live performance (e.g karaoke). The capture path will minimize latency and coupling with playback path.
- oboe_
Input Preset_ Voice Recognition - Use this preset when doing speech recognition.
- oboe_
Latency Tuner_ State_ Active - oboe_
Latency Tuner_ State_ AtMax - oboe_
Latency Tuner_ State_ Idle - oboe_
Latency Tuner_ State_ Unsupported - oboe_
Latency Tuner_ kDefault NumBursts - oboe_
Latency Tuner_ kIdle Count - oboe_
Performance Mode_ LowLatency - Reducing latency is most important.
- oboe_
Performance Mode_ None - No particular performance needs. Default.
- oboe_
Performance Mode_ Power Saving - Extending battery life is most important.
- oboe_
Privacy Sensitive Mode_ Disabled - Privacy sensitive mode disabled.
- oboe_
Privacy Sensitive Mode_ Enabled - Privacy sensitive mode enabled.
- oboe_
Privacy Sensitive Mode_ Unspecified - When not explicitly requested, set privacy sensitive mode according to input preset: communication and camcorder captures are considered privacy sensitive by default.
- oboe_
Result_ Error Base - oboe_
Result_ Error Closed - oboe_
Result_ Error Disconnected - oboe_
Result_ Error Illegal Argument - oboe_
Result_ Error Internal - oboe_
Result_ Error Invalid Format - oboe_
Result_ Error Invalid Handle - oboe_
Result_ Error Invalid Rate - oboe_
Result_ Error Invalid State - oboe_
Result_ Error NoFree Handles - oboe_
Result_ Error NoMemory - oboe_
Result_ Error NoService - oboe_
Result_ Error Null - oboe_
Result_ Error OutOf Range - oboe_
Result_ Error Timeout - oboe_
Result_ Error Unavailable - oboe_
Result_ Error Unimplemented - oboe_
Result_ Error Would Block - oboe_
Result_ OK - oboe_
Result_ Reserved1 - oboe_
Result_ Reserved2 - oboe_
Result_ Reserved3 - oboe_
Result_ Reserved4 - oboe_
Result_ Reserved5 - oboe_
Result_ Reserved6 - oboe_
Result_ Reserved7 - oboe_
Result_ Reserved8 - oboe_
Result_ Reserved9 - oboe_
Result_ Reserved10 - oboe_
Sample Rate Conversion Quality_ Best - Highest quality conversion, which may be expensive in terms of CPU.
- oboe_
Sample Rate Conversion Quality_ Fastest - Fastest conversion but may not sound great. This may be implemented using bilinear interpolation.
- oboe_
Sample Rate Conversion Quality_ High - High quality conversion with 32 taps.
- oboe_
Sample Rate Conversion Quality_ Low - Low quality conversion with 8 taps.
- oboe_
Sample Rate Conversion Quality_ Medium - Medium quality conversion with 16 taps.
- oboe_
Sample Rate Conversion Quality_ None - No conversion by Oboe. Underlying APIs may still do conversion.
- oboe_
Session Id_ Allocate - Allocate a session ID that can be used to attach and control effects using the Java AudioEffects API. Note that the use of this flag may result in higher latency.
- oboe_
Session Id_ None - Do not allocate a session ID. Effects cannot be used with this stream. Default.
- oboe_
Sharing Mode_ Exclusive - This will be the only stream using a particular source or sink. This mode will provide the lowest possible latency. You should close EXCLUSIVE streams immediately when you are not using them.
- oboe_
Sharing Mode_ Shared - Multiple applications can share the same device. The data from output streams will be mixed by the audio service. The data for input streams will be distributed by the audio service.
- oboe_
Spatialization Behavior_ Auto - Constant indicating the audio content associated with these attributes will follow the default platform behavior with regards to which content will be spatialized or not.
- oboe_
Spatialization Behavior_ Never - Constant indicating the audio content associated with these attributes should never be spatialized.
- oboe_
Spatialization Behavior_ Unspecified - Constant indicating that the spatialization behavior is not specified.
- oboe_
Stream State_ Closed - oboe_
Stream State_ Closing - oboe_
Stream State_ Disconnected - oboe_
Stream State_ Flushed - oboe_
Stream State_ Flushing - oboe_
Stream State_ Open - oboe_
Stream State_ Paused - oboe_
Stream State_ Pausing - oboe_
Stream State_ Started - oboe_
Stream State_ Starting - oboe_
Stream State_ Stopped - oboe_
Stream State_ Stopping - oboe_
Stream State_ Uninitialized - oboe_
Stream State_ Unknown - oboe_
Usage_ Alarm - Use this to demand the users attention.
- oboe_
Usage_ Assistance Accessibility - Use this for screen readers, etcetera.
- oboe_
Usage_ Assistance Navigation Guidance - Use this for driving or navigation directions.
- oboe_
Usage_ Assistance Sonification - Use this for user interface sounds, beeps, etcetera.
- oboe_
Usage_ Assistant - Use this for audio responses to user queries, audio instructions or help utterances.
- oboe_
Usage_ Game - Use this for game audio and sound effects.
- oboe_
Usage_ Media - Use this for streaming media, music performance, video, podcasts, etcetera.
- oboe_
Usage_ Notification - Use this for notifying the user when a message has arrived or some other background event has occured.
- oboe_
Usage_ Notification Event - Use this to attract the users attention when, for example, the battery is low.
- oboe_
Usage_ Notification Ringtone - Use this when the phone rings.
- oboe_
Usage_ Voice Communication - Use this for voice over IP, telephony, etcetera.
- oboe_
Usage_ Voice Communication Signalling - Use this for sounds associated with telephony such as busy tones, DTMF, etcetera.
- oboe_
Version_ Major - This is incremented when we make breaking API changes. Based loosely on https://semver.org/.
- oboe_
Version_ Minor - This is incremented when we add backwards compatible functionality. Or set to zero when MAJOR is incremented.
- oboe_
Version_ Number - Integer representation of the current Oboe library version. This will always increase when the version number changes so can be compared using integer comparison.
- oboe_
Version_ Patch - This is incremented when we make backwards compatible bug fixes. Or set to zero when MINOR is incremented.
- oboe_
Version_ Text - Version string in the form MAJOR.MINOR.PATCH.
Statics§
- oboe_
Default ⚠Stream Values_ Channel Count - The default channel count to use when opening new audio streams
- oboe_
Default ⚠Stream Values_ Frames PerBurst - The default frames per burst to use when opening new audio streams
- oboe_
Default ⚠Stream Values_ Sample Rate - The default sample rate to use when opening new audio streams
Functions§
- oboe_
Audio ⚠Stream Builder_ create - oboe_
Audio ⚠Stream Builder_ delete - oboe_
Audio ⚠Stream Builder_ getAudio Api - oboe_
Audio ⚠Stream Builder_ getBase - oboe_
Audio ⚠Stream Builder_ isAAudio Recommended - Is the AAudio API recommended this device?
- oboe_
Audio ⚠Stream Builder_ isAAudio Supported - Is the AAudio API supported on this device?
- oboe_
Audio ⚠Stream Builder_ open Stream Shared - oboe_
Audio ⚠Stream Builder_ setAudio Api - oboe_
Audio ⚠Stream Builder_ setCallback - oboe_
Audio ⚠Stream Callback Wrapper_ Audio Stream Callback Wrapper - oboe_
Audio ⚠Stream Callback Wrapper_ Audio Stream Callback Wrapper_ destructor - oboe_
Audio ⚠Stream Callback Wrapper_ onAudio Ready - oboe_
Audio ⚠Stream Callback Wrapper_ onError After Close - oboe_
Audio ⚠Stream Callback Wrapper_ onError Before Close - oboe_
Audio ⚠Stream Shared_ clone - oboe_
Audio ⚠Stream Shared_ delete - oboe_
Audio ⚠Stream Shared_ deref - oboe_
Audio ⚠Stream_ Audio Stream - Construct an
AudioStream
using the givenAudioStreamBuilder
- oboe_
Audio ⚠Stream_ calculate Default Delay Before Close Millis - This should only be called as a stream is being opened. Otherwise we might override setDelayBeforeCloseMillis().
- oboe_
Audio ⚠Stream_ calculate Latency Millis - oboe_
Audio ⚠Stream_ close - Close the stream and deallocate any resources from the open() call.
- oboe_
Audio ⚠Stream_ close1 - oboe_
Audio ⚠Stream_ fire Data Callback - Override this to provide your own behaviour for the audio callback
- oboe_
Audio ⚠Stream_ flush - Flush the stream. This will block until the stream has been flushed, an error occurs
or
timeoutNanoseconds
has been reached. - oboe_
Audio ⚠Stream_ getAudio Api - oboe_
Audio ⚠Stream_ getAvailable Frames - @return number of frames of data currently in the buffer
- oboe_
Audio ⚠Stream_ getBase - oboe_
Audio ⚠Stream_ getBytes PerSample - Get the number of bytes per sample. This is calculated using the sample format. For example, a stream using 16-bit integer samples will have 2 bytes per sample.
- oboe_
Audio ⚠Stream_ getFrames PerBurst - oboe_
Audio ⚠Stream_ getFrames Read - The number of audio frames read from the stream. This monotonic counter will never get reset.
- oboe_
Audio ⚠Stream_ getFrames Written - The number of audio frames written into the stream. This monotonic counter will never get reset.
- oboe_
Audio ⚠Stream_ getState - oboe_
Audio ⚠Stream_ getTimestamp - Get the estimated time that the frame at
framePosition
entered or left the audio processing pipeline. - oboe_
Audio ⚠Stream_ getX RunCount - oboe_
Audio ⚠Stream_ isXRun Count Supported - oboe_
Audio ⚠Stream_ open - oboe_
Audio ⚠Stream_ pause - Pause the stream. This will block until the stream has been paused, an error occurs
or
timeoutNanoseconds
has been reached. - oboe_
Audio ⚠Stream_ read - oboe_
Audio ⚠Stream_ request Flush - oboe_
Audio ⚠Stream_ request Pause - oboe_
Audio ⚠Stream_ request Start - oboe_
Audio ⚠Stream_ request Stop - oboe_
Audio ⚠Stream_ setBuffer Size InFrames - oboe_
Audio ⚠Stream_ start - Start the stream. This will block until the stream has been started, an error occurs
or
timeoutNanoseconds
has been reached. - oboe_
Audio ⚠Stream_ stop - Stop the stream. This will block until the stream has been stopped, an error occurs
or
timeoutNanoseconds
has been reached. - oboe_
Audio ⚠Stream_ wait ForAvailable Frames - Wait until the stream has a minimum amount of data available in its buffer. This can be used with an EXCLUSIVE MMAP input stream to avoid reading data too close to the DSP write position, which may cause glitches.
- oboe_
Audio ⚠Stream_ wait ForState Change - oboe_
Audio ⚠Stream_ wait ForState Transition - Wait for a transition from one state to another. @return OK if the endingState was observed, or ErrorUnexpectedState if any state that was not the startingState or endingState was observed or ErrorTimeout.
- oboe_
Audio ⚠Stream_ write - oboe_
Latency ⚠Tuner_ Latency Tuner - Construct a new LatencyTuner object which will act on the given audio stream
- oboe_
Latency ⚠Tuner_ Latency Tuner1 - Construct a new LatencyTuner object which will act on the given audio stream.
- oboe_
Latency ⚠Tuner_ isAt Maximum Buffer Size - @return true if the audio stream’s buffer size is at the maximum value. If no maximum value was specified when constructing the LatencyTuner then the value of stream->getBufferCapacityInFrames is used
- oboe_
Latency ⚠Tuner_ request Reset - This may be called from another thread. Then tune() will call reset(), which will lower the latency to the minimum and then allow it to rise back up if there are glitches.
- oboe_
Latency ⚠Tuner_ tune - Adjust the bufferSizeInFrames to optimize latency. It will start with a low latency and then raise it if an underrun occurs.
- oboe_
Stabilized ⚠Callback_ Stabilized Callback - oboe_
Stabilized ⚠Callback_ onAudio Ready - oboe_
getSdk ⚠Version - Return the version of the SDK that is currently running.
Type Aliases§
- __
clockid_ t - __
kernel_ clockid_ t - clockid_
t - oboe_
Allowed Capture Policy - Specifies whether audio may or may not be captured by other apps or the system for an output stream.
- oboe_
Audio Api - The underlying audio API used by the audio stream.
- oboe_
Audio Format - The format of audio samples.
- oboe_
Audio Ready Handler - oboe_
Audio Stream Shared - oboe_
Channel Count - The channel count of the audio stream. The underlying type is
int32_t
. Use of this enum is convenient to avoid “magic” numbers when specifying the channel count. - oboe_
Channel Mask - The channel mask of the audio stream. The underlying type is
uint32_t
. Use of this enum is convenient. - oboe_
Content Type - The ContentType attribute describes what you are playing. It expresses the general category of the content. This information is optional. But in case it is known (for instance {@link Movie} for a movie streaming service or {@link Speech} for an audio book application) this information might be used by the audio framework to enforce audio focus.
- oboe_
Data Callback Result - The result of an audio callback.
- oboe_
Direction - The direction of the stream.
- oboe_
Drop Context Handler - oboe_
Error Close Handler - oboe_
Input Preset - Defines the audio source. An audio source defines both a default physical source of audio signal, and a recording configuration.
- oboe_
Latency Tuner_ State - oboe_
Performance Mode - The performance mode of the audio stream.
- oboe_
Privacy Sensitive Mode - The PrivacySensitiveMode attribute determines whether an input stream can be shared with another privileged app, for example the Assistant.
- oboe_
Result - The result of an operation. All except the
OK
result indicates that an error occurred. TheResult
can be converted into a human readable string usingconvertToText
. - oboe_
Sample Rate Conversion Quality - Specifies the quality of the sample rate conversion performed by Oboe. Higher quality will require more CPU load. Higher quality conversion will probably be implemented using a sinc based resampler.
- oboe_
Session Id - This attribute can be used to allocate a session ID to the audio stream.
- oboe_
Sharing Mode - The sharing mode of the audio stream.
- oboe_
Spatialization Behavior - The spatialization behavior of the audio stream.
- oboe_
Stream State - The state of the audio stream.
- oboe_
Usage - The Usage attribute expresses why you are playing a sound, what is this sound used for. This information is used by certain platforms or routing policies to make more refined volume or routing decisions.
- std_
string