Crate oboe_sys

Source
Expand description

§Raw (unsafe) bindings for Oboe library

github Crates.io Package Docs.rs API Docs License: Apache-2.0 CI Status

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_AudioStream
Base class for Oboe C++ audio stream.
oboe_AudioStreamBase
Base class containing parameters for audio streams and builders.
oboe_AudioStreamBase__bindgen_vtable
oboe_AudioStreamBuilder
Factory class for an audio Stream.
oboe_AudioStreamCallback
AudioStreamCallback defines a callback interface for:
oboe_AudioStreamCallbackWrapper
oboe_AudioStreamDataCallback
AudioStreamDataCallback defines a callback interface for moving data to/from an audio stream using onAudioReady 2) being alerted when a stream has an error using onError* methods
oboe_AudioStreamDataCallback__bindgen_vtable
oboe_AudioStreamErrorCallback
AudioStreamErrorCallback defines a callback interface for being alerted when a stream has an error or is disconnected using onError* methods.
oboe_AudioStreamErrorCallback__bindgen_vtable
oboe_DefaultStreamValues
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_FrameTimestamp
The time at which the frame at position was presented
oboe_LatencyTuner
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_ResultWithValue
A ResultWithValue can store both the result of an operation (either OK or an error) and a value.
oboe_StabilizedCallback
oboe_StreamDeleterFunctor
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_AllowedCapturePolicy_All
Indicates that the audio may be captured by any app.
oboe_AllowedCapturePolicy_None
Indicates that the audio may not be recorded by any app, even if it is a system app.
oboe_AllowedCapturePolicy_System
Indicates that the audio may only be captured by system apps.
oboe_AllowedCapturePolicy_Unspecified
When not explicitly requested, set privacy sensitive mode according to the Usage. This should behave similarly to setting AllowedCapturePolicy::All.
oboe_AudioApi_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_AudioApi_OpenSLES
Use OpenSL ES. Note that OpenSL ES is deprecated in Android 13, API 30 and above.
oboe_AudioApi_Unspecified
Try to use AAudio. If not available then use OpenSL ES.
oboe_AudioFormat_Float
Single precision floating point.
oboe_AudioFormat_I16
Signed 16-bit integers.
oboe_AudioFormat_I24
Signed 24-bit integers, packed into 3 bytes.
oboe_AudioFormat_I32
Signed 32-bit integers.
oboe_AudioFormat_IEC61937
This format is used for compressed audio wrapped in IEC61937 for HDMI or S/PDIF passthrough.
oboe_AudioFormat_Invalid
Invalid format.
oboe_AudioFormat_Unspecified
Unspecified format. Format will be decided by Oboe. When calling getHardwareFormat(), this will be returned if the API is not supported.
oboe_AudioStream_kMinDelayBeforeCloseMillis
oboe_ChannelCount_Mono
Use this for mono audio
oboe_ChannelCount_Stereo
Use this for stereo audio.
oboe_ChannelCount_Unspecified
Audio channel count definition, use Mono or Stereo
oboe_ChannelMask_BackCenter
oboe_ChannelMask_BackLeft
oboe_ChannelMask_BackRight
oboe_ChannelMask_BottomFrontCenter
oboe_ChannelMask_BottomFrontLeft
oboe_ChannelMask_BottomFrontRight
oboe_ChannelMask_CM2Point0Point2
Supported for Input and Output
oboe_ChannelMask_CM2Point1
Supported for only Output
oboe_ChannelMask_CM2Point1Point2
Supported for Input and Output
oboe_ChannelMask_CM3Point0Point2
Supported for Input and Output
oboe_ChannelMask_CM3Point1
Supported for only Output
oboe_ChannelMask_CM3Point1Point2
Supported for Input and Output
oboe_ChannelMask_CM5Point1
Supported for Input and Output. aka 5Point1Back
oboe_ChannelMask_CM5Point1Point2
Supported for only Output
oboe_ChannelMask_CM5Point1Point4
Supported for only Output
oboe_ChannelMask_CM5Point1Side
Supported for only Output
oboe_ChannelMask_CM6Point1
Supported for only Output
oboe_ChannelMask_CM7Point1
Supported for only Output
oboe_ChannelMask_CM7Point1Point2
Supported for only Output
oboe_ChannelMask_CM7Point1Point4
Supported for only Output
oboe_ChannelMask_CM9Point1Point4
Supported for only Output
oboe_ChannelMask_CM9Point1Point6
Supported for only Output
oboe_ChannelMask_FrontBack
Supported for only Input
oboe_ChannelMask_FrontCenter
oboe_ChannelMask_FrontLeft
oboe_ChannelMask_FrontLeftOfCenter
oboe_ChannelMask_FrontRight
oboe_ChannelMask_FrontRightOfCenter
oboe_ChannelMask_FrontWideLeft
oboe_ChannelMask_FrontWideRight
oboe_ChannelMask_LowFrequency
oboe_ChannelMask_LowFrequency2
oboe_ChannelMask_Mono
Supported for Input and Output
oboe_ChannelMask_Penta
Supported for only Output
oboe_ChannelMask_Quad
Supported for only Output
oboe_ChannelMask_QuadSide
Supported for only Output
oboe_ChannelMask_SideLeft
oboe_ChannelMask_SideRight
oboe_ChannelMask_Stereo
Supported for Input and Output
oboe_ChannelMask_Surround
Supported for only Output
oboe_ChannelMask_TopBackCenter
oboe_ChannelMask_TopBackLeft
oboe_ChannelMask_TopBackRight
oboe_ChannelMask_TopCenter
oboe_ChannelMask_TopFrontCenter
oboe_ChannelMask_TopFrontLeft
oboe_ChannelMask_TopFrontRight
oboe_ChannelMask_TopSideLeft
oboe_ChannelMask_TopSideRight
oboe_ChannelMask_Tri
Supported for only Output
oboe_ChannelMask_TriBack
Supported for only Output
oboe_ChannelMask_Unspecified
oboe_ContentType_Movie
Use this for a movie or video soundtrack.
oboe_ContentType_Music
Use this for pre-recorded or live music.
oboe_ContentType_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_ContentType_Speech
Use this for spoken voice, audio books, etcetera.
oboe_DataCallbackResult_Continue
oboe_DataCallbackResult_Stop
oboe_Direction_Input
Used for recording.
oboe_Direction_Output
Used for playback.
oboe_InputPreset_Camcorder
Use this preset when recording video.
oboe_InputPreset_Generic
Use this preset when other presets do not apply.
oboe_InputPreset_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_InputPreset_VoiceCommunication
Use this preset when doing telephony or voice messaging.
oboe_InputPreset_VoicePerformance
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_InputPreset_VoiceRecognition
Use this preset when doing speech recognition.
oboe_LatencyTuner_State_Active
oboe_LatencyTuner_State_AtMax
oboe_LatencyTuner_State_Idle
oboe_LatencyTuner_State_Unsupported
oboe_LatencyTuner_kDefaultNumBursts
oboe_LatencyTuner_kIdleCount
oboe_PerformanceMode_LowLatency
Reducing latency is most important.
oboe_PerformanceMode_None
No particular performance needs. Default.
oboe_PerformanceMode_PowerSaving
Extending battery life is most important.
oboe_PrivacySensitiveMode_Disabled
Privacy sensitive mode disabled.
oboe_PrivacySensitiveMode_Enabled
Privacy sensitive mode enabled.
oboe_PrivacySensitiveMode_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_ErrorBase
oboe_Result_ErrorClosed
oboe_Result_ErrorDisconnected
oboe_Result_ErrorIllegalArgument
oboe_Result_ErrorInternal
oboe_Result_ErrorInvalidFormat
oboe_Result_ErrorInvalidHandle
oboe_Result_ErrorInvalidRate
oboe_Result_ErrorInvalidState
oboe_Result_ErrorNoFreeHandles
oboe_Result_ErrorNoMemory
oboe_Result_ErrorNoService
oboe_Result_ErrorNull
oboe_Result_ErrorOutOfRange
oboe_Result_ErrorTimeout
oboe_Result_ErrorUnavailable
oboe_Result_ErrorUnimplemented
oboe_Result_ErrorWouldBlock
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_SampleRateConversionQuality_Best
Highest quality conversion, which may be expensive in terms of CPU.
oboe_SampleRateConversionQuality_Fastest
Fastest conversion but may not sound great. This may be implemented using bilinear interpolation.
oboe_SampleRateConversionQuality_High
High quality conversion with 32 taps.
oboe_SampleRateConversionQuality_Low
Low quality conversion with 8 taps.
oboe_SampleRateConversionQuality_Medium
Medium quality conversion with 16 taps.
oboe_SampleRateConversionQuality_None
No conversion by Oboe. Underlying APIs may still do conversion.
oboe_SessionId_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_SessionId_None
Do not allocate a session ID. Effects cannot be used with this stream. Default.
oboe_SharingMode_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_SharingMode_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_SpatializationBehavior_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_SpatializationBehavior_Never
Constant indicating the audio content associated with these attributes should never be spatialized.
oboe_SpatializationBehavior_Unspecified
Constant indicating that the spatialization behavior is not specified.
oboe_StreamState_Closed
oboe_StreamState_Closing
oboe_StreamState_Disconnected
oboe_StreamState_Flushed
oboe_StreamState_Flushing
oboe_StreamState_Open
oboe_StreamState_Paused
oboe_StreamState_Pausing
oboe_StreamState_Started
oboe_StreamState_Starting
oboe_StreamState_Stopped
oboe_StreamState_Stopping
oboe_StreamState_Uninitialized
oboe_StreamState_Unknown
oboe_Usage_Alarm
Use this to demand the users attention.
oboe_Usage_AssistanceAccessibility
Use this for screen readers, etcetera.
oboe_Usage_AssistanceNavigationGuidance
Use this for driving or navigation directions.
oboe_Usage_AssistanceSonification
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_NotificationEvent
Use this to attract the users attention when, for example, the battery is low.
oboe_Usage_NotificationRingtone
Use this when the phone rings.
oboe_Usage_VoiceCommunication
Use this for voice over IP, telephony, etcetera.
oboe_Usage_VoiceCommunicationSignalling
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_DefaultStreamValues_ChannelCount
The default channel count to use when opening new audio streams
oboe_DefaultStreamValues_FramesPerBurst
The default frames per burst to use when opening new audio streams
oboe_DefaultStreamValues_SampleRate
The default sample rate to use when opening new audio streams

Functions§

oboe_AudioStreamBuilder_create
oboe_AudioStreamBuilder_delete
oboe_AudioStreamBuilder_getAudioApi
oboe_AudioStreamBuilder_getBase
oboe_AudioStreamBuilder_isAAudioRecommended
Is the AAudio API recommended this device?
oboe_AudioStreamBuilder_isAAudioSupported
Is the AAudio API supported on this device?
oboe_AudioStreamBuilder_openStreamShared
oboe_AudioStreamBuilder_setAudioApi
oboe_AudioStreamBuilder_setCallback
oboe_AudioStreamCallbackWrapper_AudioStreamCallbackWrapper
oboe_AudioStreamCallbackWrapper_AudioStreamCallbackWrapper_destructor
oboe_AudioStreamCallbackWrapper_onAudioReady
oboe_AudioStreamCallbackWrapper_onErrorAfterClose
oboe_AudioStreamCallbackWrapper_onErrorBeforeClose
oboe_AudioStreamShared_clone
oboe_AudioStreamShared_delete
oboe_AudioStreamShared_deref
oboe_AudioStream_AudioStream
Construct an AudioStream using the given AudioStreamBuilder
oboe_AudioStream_calculateDefaultDelayBeforeCloseMillis
This should only be called as a stream is being opened. Otherwise we might override setDelayBeforeCloseMillis().
oboe_AudioStream_calculateLatencyMillis
oboe_AudioStream_close
Close the stream and deallocate any resources from the open() call.
oboe_AudioStream_close1
oboe_AudioStream_fireDataCallback
Override this to provide your own behaviour for the audio callback
oboe_AudioStream_flush
Flush the stream. This will block until the stream has been flushed, an error occurs or timeoutNanoseconds has been reached.
oboe_AudioStream_getAudioApi
oboe_AudioStream_getAvailableFrames
@return number of frames of data currently in the buffer
oboe_AudioStream_getBase
oboe_AudioStream_getBytesPerSample
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_AudioStream_getFramesPerBurst
oboe_AudioStream_getFramesRead
The number of audio frames read from the stream. This monotonic counter will never get reset.
oboe_AudioStream_getFramesWritten
The number of audio frames written into the stream. This monotonic counter will never get reset.
oboe_AudioStream_getState
oboe_AudioStream_getTimestamp
Get the estimated time that the frame at framePosition entered or left the audio processing pipeline.
oboe_AudioStream_getXRunCount
oboe_AudioStream_isXRunCountSupported
oboe_AudioStream_open
oboe_AudioStream_pause
Pause the stream. This will block until the stream has been paused, an error occurs or timeoutNanoseconds has been reached.
oboe_AudioStream_read
oboe_AudioStream_requestFlush
oboe_AudioStream_requestPause
oboe_AudioStream_requestStart
oboe_AudioStream_requestStop
oboe_AudioStream_setBufferSizeInFrames
oboe_AudioStream_start
Start the stream. This will block until the stream has been started, an error occurs or timeoutNanoseconds has been reached.
oboe_AudioStream_stop
Stop the stream. This will block until the stream has been stopped, an error occurs or timeoutNanoseconds has been reached.
oboe_AudioStream_waitForAvailableFrames
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_AudioStream_waitForStateChange
oboe_AudioStream_waitForStateTransition
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_AudioStream_write
oboe_LatencyTuner_LatencyTuner
Construct a new LatencyTuner object which will act on the given audio stream
oboe_LatencyTuner_LatencyTuner1
Construct a new LatencyTuner object which will act on the given audio stream.
oboe_LatencyTuner_isAtMaximumBufferSize
@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_LatencyTuner_requestReset
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_LatencyTuner_tune
Adjust the bufferSizeInFrames to optimize latency. It will start with a low latency and then raise it if an underrun occurs.
oboe_StabilizedCallback_StabilizedCallback
oboe_StabilizedCallback_onAudioReady
oboe_getSdkVersion
Return the version of the SDK that is currently running.

Type Aliases§

__clockid_t
__kernel_clockid_t
clockid_t
oboe_AllowedCapturePolicy
Specifies whether audio may or may not be captured by other apps or the system for an output stream.
oboe_AudioApi
The underlying audio API used by the audio stream.
oboe_AudioFormat
The format of audio samples.
oboe_AudioReadyHandler
oboe_AudioStreamShared
oboe_ChannelCount
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_ChannelMask
The channel mask of the audio stream. The underlying type is uint32_t. Use of this enum is convenient.
oboe_ContentType
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_DataCallbackResult
The result of an audio callback.
oboe_Direction
The direction of the stream.
oboe_DropContextHandler
oboe_ErrorCloseHandler
oboe_InputPreset
Defines the audio source. An audio source defines both a default physical source of audio signal, and a recording configuration.
oboe_LatencyTuner_State
oboe_PerformanceMode
The performance mode of the audio stream.
oboe_PrivacySensitiveMode
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. The Result can be converted into a human readable string using convertToText.
oboe_SampleRateConversionQuality
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_SessionId
This attribute can be used to allocate a session ID to the audio stream.
oboe_SharingMode
The sharing mode of the audio stream.
oboe_SpatializationBehavior
The spatialization behavior of the audio stream.
oboe_StreamState
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