Oboe
1.5
A library for creating real-time audio apps on Android
|
Classes | |
class | AudioStream |
class | AudioStreamBase |
class | AudioStreamBuilder |
class | AudioStreamCallback |
class | AudioStreamDataCallback |
class | AudioStreamErrorCallback |
class | DefaultStreamValues |
struct | FrameTimestamp |
class | LatencyTuner |
class | OboeGlobals |
class | ResultWithValue |
class | StabilizedCallback |
struct | StreamDeleterFunctor |
struct | Version |
Typedefs | |
using | ManagedStream = std::unique_ptr< AudioStream, StreamDeleterFunctor > |
Enumerations | |
enum | StreamState : int32_t { Uninitialized = 0, Unknown = 1, Open = 2, Starting = 3, Started = 4, Pausing = 5, Paused = 6, Flushing = 7, Flushed = 8, Stopping = 9, Stopped = 10, Closing = 11, Closed = 12, Disconnected = 13 } |
enum | Direction : int32_t { Direction::Output = 0, Direction::Input = 1 } |
enum | AudioFormat : int32_t { AudioFormat::Invalid = -1, Unspecified = 0, AudioFormat::I16 = 1, AudioFormat::Float = 2 } |
enum | DataCallbackResult : int32_t { Continue = 0, Stop = 1 } |
enum | Result : int32_t { OK = 0, ErrorBase = -900, ErrorDisconnected = -899, ErrorIllegalArgument = -898, ErrorInternal = -896, ErrorInvalidState = -895, ErrorInvalidHandle = -892, ErrorUnimplemented = -890, ErrorUnavailable = -889, ErrorNoFreeHandles = -888, ErrorNoMemory = -887, ErrorNull = -886, ErrorTimeout = -885, ErrorWouldBlock = -884, ErrorInvalidFormat = -883, ErrorOutOfRange = -882, ErrorNoService = -881, ErrorInvalidRate = -880, Reserved1, Reserved2, Reserved3, Reserved4, Reserved5, Reserved6, Reserved7, Reserved8, Reserved9, Reserved10, ErrorClosed } |
enum | SharingMode : int32_t { SharingMode::Exclusive = 0, SharingMode::Shared = 1 } |
enum | PerformanceMode : int32_t { None = 10, PerformanceMode::PowerSaving = 11, PerformanceMode::LowLatency = 12 } |
enum | AudioApi : int32_t { Unspecified = kUnspecified, AudioApi::OpenSLES, AudioApi::AAudio } |
enum | SampleRateConversionQuality : int32_t { None, SampleRateConversionQuality::Fastest, Low, Medium, High, SampleRateConversionQuality::Best } |
enum | Usage : int32_t { Usage::Media = 1, VoiceCommunication = 2, Usage::VoiceCommunicationSignalling = 3, Usage::Alarm = 4, Usage::Notification = 5, Usage::NotificationRingtone = 6, Usage::NotificationEvent = 10, Usage::AssistanceAccessibility = 11, Usage::AssistanceNavigationGuidance = 12, Usage::AssistanceSonification = 13, Usage::Game = 14, Usage::Assistant = 16 } |
enum | ContentType : int32_t { Speech = 1, Music = 2, Movie = 3, Sonification = 4 } |
enum | InputPreset : int32_t { Generic = 1, Camcorder = 5, VoiceRecognition = 6, VoiceCommunication = 7, VoiceCommunication = 2, Unprocessed = 9, VoicePerformance = 10 } |
enum | SessionId { None = -1, None = 10, None, Allocate = 0 } |
enum | ChannelCount : int32_t { Unspecified = kUnspecified, Unspecified = 0, Unspecified = kUnspecified, Mono = 1, Stereo = 2 } |
Functions | |
template<typename T > | |
std::ostream & | operator<< (std::ostream &strm, const ResultWithValue< T > &result) |
void | convertFloatToPcm16 (const float *source, int16_t *destination, int32_t numSamples) |
void | convertPcm16ToFloat (const int16_t *source, float *destination, int32_t numSamples) |
int32_t | convertFormatToSizeInBytes (AudioFormat format) |
template<typename FromType > | |
const char * | convertToText (FromType input) |
std::string | getPropertyString (const char *name) |
int | getPropertyInteger (const char *name, int defaultValue) |
int | getSdkVersion () |
const char * | getVersionText () |
Variables | |
constexpr int64_t | kDefaultTimeoutNanos = (2000 * kNanosPerMillisecond) |
constexpr int32_t | kUnspecified = 0 |
constexpr int64_t | kNanosPerMicrosecond = 1000 |
constexpr int64_t | kNanosPerMillisecond = kNanosPerMicrosecond * 1000 |
constexpr int64_t | kMillisPerSecond = 1000 |
constexpr int64_t | kNanosPerSecond = kNanosPerMillisecond * kMillisPerSecond |
WARNING - UNDER CONSTRUCTION - THIS API WILL CHANGE.
|
strong |
|
strong |
enum oboe::ChannelCount : int32_t |
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.
For example, you can write builder.setChannelCount(ChannelCount::Stereo)
rather than builder.setChannelCount(2)
enum oboe::ContentType : int32_t |
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 Movie for a movie streaming service or Speech for an audio book application) this information might be used by the audio framework to enforce audio focus.
Note that these match the equivalent values in AudioAttributes in the Android Java API.
This attribute only has an effect on Android API 28+.
|
strong |
The result of an audio callback.
|
strong |
enum oboe::InputPreset : int32_t |
Defines the audio source. An audio source defines both a default physical source of audio signal, and a recording configuration.
Note that these match the equivalent values in MediaRecorder.AudioSource in the Android Java API.
This attribute only has an effect on Android API 28+.
|
strong |
|
strong |
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
.
|
strong |
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.
enum oboe::SessionId |
This attribute can be used to allocate a session ID to the audio stream.
This attribute only has an effect on Android API 28+.
|
strong |
The sharing mode of the audio stream.
|
strong |
The state of the audio stream.
|
strong |
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.
Note that these match the equivalent values in AudioAttributes in the Android Java API.
This attribute only has an effect on Android API 28+.
void oboe::convertFloatToPcm16 | ( | const float * | source, |
int16_t * | destination, | ||
int32_t | numSamples | ||
) |
Convert an array of floats to an array of 16-bit integers.
source | the input array. |
destination | the output array. |
numSamples | the number of values to convert. |
int32_t oboe::convertFormatToSizeInBytes | ( | AudioFormat | format | ) |
void oboe::convertPcm16ToFloat | ( | const int16_t * | source, |
float * | destination, | ||
int32_t | numSamples | ||
) |
Convert an array of 16-bit integers to an array of floats.
source | the input array. |
destination | the output array. |
numSamples | the number of values to convert. |
const char* oboe::convertToText | ( | FromType | input | ) |
The text is the ASCII symbol corresponding to the supplied Oboe enum value, or an English message saying the value is unrecognized. This is intended for developers to use when debugging. It is not for displaying to users.
input | object to convert from. |
int oboe::getPropertyInteger | ( | const char * | name, |
int | defaultValue | ||
) |
name | |
defaultValue |
std::string oboe::getPropertyString | ( | const char * | name | ) |
name |
int oboe::getSdkVersion | ( | ) |
Return the version of the SDK that is currently running.
For example, on Android, this would return 27 for Oreo 8.1. If the version number cannot be determined then this will return -1.
std::ostream& oboe::operator<< | ( | std::ostream & | strm, |
const ResultWithValue< T > & | result | ||
) |
If the result is OK
then return the value, otherwise return a human-readable error message.
constexpr int64_t oboe::kDefaultTimeoutNanos = (2000 * kNanosPerMillisecond) |
The default number of nanoseconds to wait for when performing state change operations on the stream, such as start
and stop
.
constexpr int64_t oboe::kMillisPerSecond = 1000 |
The number of milliseconds in a second. 1,000.
constexpr int64_t oboe::kNanosPerMicrosecond = 1000 |
The number of nanoseconds in a microsecond. 1,000.
constexpr int64_t oboe::kNanosPerMillisecond = kNanosPerMicrosecond * 1000 |
The number of nanoseconds in a millisecond. 1,000,000.
constexpr int64_t oboe::kNanosPerSecond = kNanosPerMillisecond * kMillisPerSecond |
The number of nanoseconds in a second. 1,000,000,000.
constexpr int32_t oboe::kUnspecified = 0 |
Represents any attribute, property or value which hasn't been specified.