diff --git a/docs/reference/a00002_source.html b/docs/reference/a00002_source.html index e22584d08..ebf8d5d54 100644 --- a/docs/reference/a00002_source.html +++ b/docs/reference/a00002_source.html @@ -71,58 +71,57 @@
-Classes | |
class | AudioStream |
class | AudioStreamBase |
class | AudioStreamBuilder |
class | AudioStreamCallback |
class | DefaultStreamValues |
class | LatencyTuner |
class | ResultWithValue |
struct | Version |
-Enumerations | |
enum | StreamState : aaudio_stream_state_t { - Uninitialized = AAUDIO_STREAM_STATE_UNINITIALIZED, -Unknown = AAUDIO_STREAM_STATE_UNKNOWN, -Open = AAUDIO_STREAM_STATE_OPEN, -Starting = AAUDIO_STREAM_STATE_STARTING, - - Started = AAUDIO_STREAM_STATE_STARTED, -Pausing = AAUDIO_STREAM_STATE_PAUSING, -Paused = AAUDIO_STREAM_STATE_PAUSED, -Flushing = AAUDIO_STREAM_STATE_FLUSHING, - - Flushed = AAUDIO_STREAM_STATE_FLUSHED, -Stopping = AAUDIO_STREAM_STATE_STOPPING, -Stopped = AAUDIO_STREAM_STATE_STOPPED, -Closing = AAUDIO_STREAM_STATE_CLOSING, - - Closed = AAUDIO_STREAM_STATE_CLOSED, -Disconnected = AAUDIO_STREAM_STATE_DISCONNECTED - - } |
enum | Direction : aaudio_direction_t { Direction::Output = AAUDIO_DIRECTION_OUTPUT, -Direction::Input = AAUDIO_DIRECTION_INPUT - } |
enum | AudioFormat : aaudio_format_t { AudioFormat::Invalid = AAUDIO_FORMAT_INVALID, -Unspecified = AAUDIO_FORMAT_UNSPECIFIED, -AudioFormat::I16 = AAUDIO_FORMAT_PCM_I16, -AudioFormat::Float = AAUDIO_FORMAT_PCM_FLOAT - } |
enum | DataCallbackResult : aaudio_data_callback_result_t { Continue = AAUDIO_CALLBACK_RESULT_CONTINUE, -Stop = AAUDIO_CALLBACK_RESULT_STOP - } |
enum | Result : aaudio_result_t { - OK, -ErrorBase = AAUDIO_ERROR_BASE, -ErrorDisconnected = AAUDIO_ERROR_DISCONNECTED, -ErrorIllegalArgument = AAUDIO_ERROR_ILLEGAL_ARGUMENT, - - ErrorInternal = AAUDIO_ERROR_INTERNAL, -ErrorInvalidState = AAUDIO_ERROR_INVALID_STATE, -ErrorInvalidHandle = AAUDIO_ERROR_INVALID_HANDLE, -ErrorUnimplemented = AAUDIO_ERROR_UNIMPLEMENTED, - - ErrorUnavailable = AAUDIO_ERROR_UNAVAILABLE, -ErrorNoFreeHandles = AAUDIO_ERROR_NO_FREE_HANDLES, -ErrorNoMemory = AAUDIO_ERROR_NO_MEMORY, -ErrorNull = AAUDIO_ERROR_NULL, - - ErrorTimeout = AAUDIO_ERROR_TIMEOUT, -ErrorWouldBlock = AAUDIO_ERROR_WOULD_BLOCK, -ErrorInvalidFormat = AAUDIO_ERROR_INVALID_FORMAT, -ErrorOutOfRange = AAUDIO_ERROR_OUT_OF_RANGE, - - ErrorNoService = AAUDIO_ERROR_NO_SERVICE, -ErrorInvalidRate = AAUDIO_ERROR_INVALID_RATE, -Reserved1, -Reserved2, - - Reserved3, -Reserved4, -Reserved5, -Reserved6, - - Reserved7, -Reserved8, -Reserved9, -Reserved10, - - ErrorClosed - - } |
enum | SharingMode : aaudio_sharing_mode_t { SharingMode::Exclusive = AAUDIO_SHARING_MODE_EXCLUSIVE, -SharingMode::Shared = AAUDIO_SHARING_MODE_SHARED - } |
enum | PerformanceMode : aaudio_performance_mode_t { None = AAUDIO_PERFORMANCE_MODE_NONE, -PerformanceMode::PowerSaving = AAUDIO_PERFORMANCE_MODE_POWER_SAVING, -PerformanceMode::LowLatency = AAUDIO_PERFORMANCE_MODE_LOW_LATENCY - } |
enum | AudioApi : int32_t { Unspecified = kUnspecified, -AudioApi::OpenSLES, -AudioApi::AAudio - } |
enum | Usage : aaudio_usage_t { - Usage::Media = CONSTANT_API_P(1, AAUDIO_USAGE_MEDIA), -VoiceCommunication = CONSTANT_API_P(2, AAUDIO_USAGE_VOICE_COMMUNICATION), -Usage::VoiceCommunicationSignalling, -Usage::Alarm = CONSTANT_API_P(4, AAUDIO_USAGE_ALARM), - - Usage::Notification = CONSTANT_API_P(5, AAUDIO_USAGE_NOTIFICATION), -Usage::NotificationRingtone = CONSTANT_API_P(6, AAUDIO_USAGE_NOTIFICATION_RINGTONE), -Usage::NotificationEvent = CONSTANT_API_P(10, AAUDIO_USAGE_NOTIFICATION_EVENT), -Usage::AssistanceAccessibility = CONSTANT_API_P(11, AAUDIO_USAGE_ASSISTANCE_ACCESSIBILITY), - - Usage::AssistanceNavigationGuidance, -Usage::AssistanceSonification = CONSTANT_API_P(13, AAUDIO_USAGE_ASSISTANCE_SONIFICATION), -Usage::Game = CONSTANT_API_P(14, AAUDIO_USAGE_GAME), -Usage::Assistant = CONSTANT_API_P(16, AAUDIO_USAGE_ASSISTANT) - - } |
enum | ContentType : aaudio_content_type_t { Speech = CONSTANT_API_P(1, AAUDIO_CONTENT_TYPE_SPEECH), -Music = CONSTANT_API_P(2, AAUDIO_CONTENT_TYPE_MUSIC), -Movie = CONSTANT_API_P(3, AAUDIO_CONTENT_TYPE_MOVIE), -Sonification = CONSTANT_API_P(4, AAUDIO_CONTENT_TYPE_SONIFICATION) - } |
enum | InputPreset : aaudio_input_preset_t { - Generic = CONSTANT_API_P(1, AAUDIO_INPUT_PRESET_GENERIC), -Camcorder = CONSTANT_API_P(5, AAUDIO_INPUT_PRESET_CAMCORDER), -VoiceRecognition = CONSTANT_API_P(6, AAUDIO_INPUT_PRESET_VOICE_RECOGNITION), -VoiceCommunication = CONSTANT_API_P(7, AAUDIO_INPUT_PRESET_VOICE_COMMUNICATION), - - VoiceCommunication = CONSTANT_API_P(2, AAUDIO_USAGE_VOICE_COMMUNICATION), -Unprocessed = CONSTANT_API_P(9, AAUDIO_INPUT_PRESET_UNPROCESSED) - - } |
enum | SessionId { None = CONSTANT_API_P(-1, AAUDIO_SESSION_ID_NONE), -None = AAUDIO_PERFORMANCE_MODE_NONE, -Allocate = CONSTANT_API_P(0, AAUDIO_SESSION_ID_ALLOCATE) - } |
enum | ChannelCount : int32_t { - Unspecified = kUnspecified, -Unspecified = AAUDIO_FORMAT_UNSPECIFIED, -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) |
int | getSdkVersion () |
-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 : aaudio_content_type_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 : aaudio_input_preset_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
.
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. |
AudioStream::getState
. 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::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.
- -+Classes | |
class | AudioStream |
class | AudioStreamBase |
class | AudioStreamBuilder |
class | AudioStreamCallback |
class | DefaultStreamValues |
class | LatencyTuner |
class | ResultWithValue |
struct | Version |
+Enumerations | |
enum | StreamState : aaudio_stream_state_t { + Uninitialized = AAUDIO_STREAM_STATE_UNINITIALIZED, +Unknown = AAUDIO_STREAM_STATE_UNKNOWN, +Open = AAUDIO_STREAM_STATE_OPEN, +Starting = AAUDIO_STREAM_STATE_STARTING, + + Started = AAUDIO_STREAM_STATE_STARTED, +Pausing = AAUDIO_STREAM_STATE_PAUSING, +Paused = AAUDIO_STREAM_STATE_PAUSED, +Flushing = AAUDIO_STREAM_STATE_FLUSHING, + + Flushed = AAUDIO_STREAM_STATE_FLUSHED, +Stopping = AAUDIO_STREAM_STATE_STOPPING, +Stopped = AAUDIO_STREAM_STATE_STOPPED, +Closing = AAUDIO_STREAM_STATE_CLOSING, + + Closed = AAUDIO_STREAM_STATE_CLOSED, +Disconnected = AAUDIO_STREAM_STATE_DISCONNECTED + + } |
enum | Direction : aaudio_direction_t { Direction::Output = AAUDIO_DIRECTION_OUTPUT, +Direction::Input = AAUDIO_DIRECTION_INPUT + } |
enum | AudioFormat : aaudio_format_t { AudioFormat::Invalid = AAUDIO_FORMAT_INVALID, +Unspecified = AAUDIO_FORMAT_UNSPECIFIED, +AudioFormat::I16 = AAUDIO_FORMAT_PCM_I16, +AudioFormat::Float = AAUDIO_FORMAT_PCM_FLOAT + } |
enum | DataCallbackResult : aaudio_data_callback_result_t { Continue = AAUDIO_CALLBACK_RESULT_CONTINUE, +Stop = AAUDIO_CALLBACK_RESULT_STOP + } |
enum | Result : aaudio_result_t { + OK, +ErrorBase = AAUDIO_ERROR_BASE, +ErrorDisconnected = AAUDIO_ERROR_DISCONNECTED, +ErrorIllegalArgument = AAUDIO_ERROR_ILLEGAL_ARGUMENT, + + ErrorInternal = AAUDIO_ERROR_INTERNAL, +ErrorInvalidState = AAUDIO_ERROR_INVALID_STATE, +ErrorInvalidHandle = AAUDIO_ERROR_INVALID_HANDLE, +ErrorUnimplemented = AAUDIO_ERROR_UNIMPLEMENTED, + + ErrorUnavailable = AAUDIO_ERROR_UNAVAILABLE, +ErrorNoFreeHandles = AAUDIO_ERROR_NO_FREE_HANDLES, +ErrorNoMemory = AAUDIO_ERROR_NO_MEMORY, +ErrorNull = AAUDIO_ERROR_NULL, + + ErrorTimeout = AAUDIO_ERROR_TIMEOUT, +ErrorWouldBlock = AAUDIO_ERROR_WOULD_BLOCK, +ErrorInvalidFormat = AAUDIO_ERROR_INVALID_FORMAT, +ErrorOutOfRange = AAUDIO_ERROR_OUT_OF_RANGE, + + ErrorNoService = AAUDIO_ERROR_NO_SERVICE, +ErrorInvalidRate = AAUDIO_ERROR_INVALID_RATE, +Reserved1, +Reserved2, + + Reserved3, +Reserved4, +Reserved5, +Reserved6, + + Reserved7, +Reserved8, +Reserved9, +Reserved10, + + ErrorClosed + + } |
enum | SharingMode : aaudio_sharing_mode_t { SharingMode::Exclusive = AAUDIO_SHARING_MODE_EXCLUSIVE, +SharingMode::Shared = AAUDIO_SHARING_MODE_SHARED + } |
enum | PerformanceMode : aaudio_performance_mode_t { None = AAUDIO_PERFORMANCE_MODE_NONE, +PerformanceMode::PowerSaving = AAUDIO_PERFORMANCE_MODE_POWER_SAVING, +PerformanceMode::LowLatency = AAUDIO_PERFORMANCE_MODE_LOW_LATENCY + } |
enum | AudioApi : int32_t { Unspecified = kUnspecified, +AudioApi::OpenSLES, +AudioApi::AAudio + } |
enum | Usage : aaudio_usage_t { + Usage::Media = CONSTANT_API_P(1, AAUDIO_USAGE_MEDIA), +VoiceCommunication = CONSTANT_API_P(2, AAUDIO_USAGE_VOICE_COMMUNICATION), +Usage::VoiceCommunicationSignalling, +Usage::Alarm = CONSTANT_API_P(4, AAUDIO_USAGE_ALARM), + + Usage::Notification = CONSTANT_API_P(5, AAUDIO_USAGE_NOTIFICATION), +Usage::NotificationRingtone = CONSTANT_API_P(6, AAUDIO_USAGE_NOTIFICATION_RINGTONE), +Usage::NotificationEvent = CONSTANT_API_P(10, AAUDIO_USAGE_NOTIFICATION_EVENT), +Usage::AssistanceAccessibility = CONSTANT_API_P(11, AAUDIO_USAGE_ASSISTANCE_ACCESSIBILITY), + + Usage::AssistanceNavigationGuidance, +Usage::AssistanceSonification = CONSTANT_API_P(13, AAUDIO_USAGE_ASSISTANCE_SONIFICATION), +Usage::Game = CONSTANT_API_P(14, AAUDIO_USAGE_GAME), +Usage::Assistant = CONSTANT_API_P(16, AAUDIO_USAGE_ASSISTANT) + + } |
enum | ContentType : aaudio_content_type_t { Speech = CONSTANT_API_P(1, AAUDIO_CONTENT_TYPE_SPEECH), +Music = CONSTANT_API_P(2, AAUDIO_CONTENT_TYPE_MUSIC), +Movie = CONSTANT_API_P(3, AAUDIO_CONTENT_TYPE_MOVIE), +Sonification = CONSTANT_API_P(4, AAUDIO_CONTENT_TYPE_SONIFICATION) + } |
enum | InputPreset : aaudio_input_preset_t { + Generic = CONSTANT_API_P(1, AAUDIO_INPUT_PRESET_GENERIC), +Camcorder = CONSTANT_API_P(5, AAUDIO_INPUT_PRESET_CAMCORDER), +VoiceRecognition = CONSTANT_API_P(6, AAUDIO_INPUT_PRESET_VOICE_RECOGNITION), +VoiceCommunication = CONSTANT_API_P(7, AAUDIO_INPUT_PRESET_VOICE_COMMUNICATION), + + VoiceCommunication = CONSTANT_API_P(2, AAUDIO_USAGE_VOICE_COMMUNICATION), +Unprocessed = CONSTANT_API_P(9, AAUDIO_INPUT_PRESET_UNPROCESSED) + + } |
enum | SessionId { None = CONSTANT_API_P(-1, AAUDIO_SESSION_ID_NONE), +None = AAUDIO_PERFORMANCE_MODE_NONE, +Allocate = CONSTANT_API_P(0, AAUDIO_SESSION_ID_ALLOCATE) + } |
enum | ChannelCount : int32_t { + Unspecified = kUnspecified, +Unspecified = AAUDIO_FORMAT_UNSPECIFIED, +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) |
int | getSdkVersion () |
+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 | +
This is the complete list of members for oboe::AudioStream, including all inherited members.
-
+
|
+ +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 : aaudio_content_type_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 : aaudio_input_preset_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
.
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::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.
+ +This is the complete list of members for oboe::AudioStreamBase, including all inherited members.
-#include <AudioStream.h>
+Public Member Functions | |
AudioStream (const AudioStreamBuilder &builder) | |
virtual Result | open () |
virtual Result | close ()=0 |
virtual Result | start (int64_t timeoutNanoseconds=kDefaultTimeoutNanos) |
virtual Result | pause (int64_t timeoutNanoseconds=kDefaultTimeoutNanos) |
virtual Result | flush (int64_t timeoutNanoseconds=kDefaultTimeoutNanos) |
virtual Result | stop (int64_t timeoutNanoseconds=kDefaultTimeoutNanos) |
virtual Result | requestStart ()=0 |
virtual Result | requestPause ()=0 |
virtual Result | requestFlush ()=0 |
virtual Result | requestStop ()=0 |
virtual StreamState | getState ()=0 |
virtual Result | waitForStateChange (StreamState inputState, StreamState *nextState, int64_t timeoutNanoseconds)=0 |
virtual ResultWithValue< int32_t > | setBufferSizeInFrames (int32_t requestedFrames) |
virtual ResultWithValue< int32_t > | getXRunCount () const |
virtual bool | isXRunCountSupported () const =0 |
virtual int32_t | getFramesPerBurst ()=0 |
bool | isPlaying () |
int32_t | getBytesPerFrame () const |
int32_t | getBytesPerSample () const |
virtual int64_t | getFramesWritten () |
virtual int64_t | getFramesRead () |
virtual ResultWithValue< double > | calculateLatencyMillis () |
virtual Result | getTimestamp (clockid_t clockId, int64_t *framePosition, int64_t *timeNanoseconds) |
virtual ResultWithValue< int32_t > | write (const void *buffer, int32_t numFrames, int64_t timeoutNanoseconds) |
virtual ResultWithValue< int32_t > | read (void *buffer, int32_t numFrames, int64_t timeoutNanoseconds) |
virtual AudioApi | getAudioApi () const =0 |
bool | usesAAudio () const |
virtual void * | getUnderlyingStream () const |
![]() | |
AudioStreamBase (const AudioStreamBase &)=default | |
AudioStreamBase & | operator= (const AudioStreamBase &)=default |
int | getChannelCount () const |
Direction | getDirection () const |
int32_t | getSampleRate () const |
int | getFramesPerCallback () const |
AudioFormat | getFormat () const |
virtual int32_t | getBufferSizeInFrames () |
virtual int32_t | getBufferCapacityInFrames () const |
SharingMode | getSharingMode () const |
PerformanceMode | getPerformanceMode () const |
int32_t | getDeviceId () const |
AudioStreamCallback * | getCallback () const |
Usage | getUsage () const |
ContentType | getContentType () const |
InputPreset | getInputPreset () const |
SessionId | getSessionId () const |
+Protected Member Functions | |
virtual int64_t | incrementFramesWritten (int32_t frames) |
virtual int64_t | incrementFramesRead (int32_t frames) |
virtual Result | waitForStateTransition (StreamState startingState, StreamState endingState, int64_t timeoutNanoseconds) |
virtual DataCallbackResult | onDefaultCallback (void *audioData, int numFrames) |
DataCallbackResult | fireCallback (void *audioData, int numFrames) |
virtual void | setNativeFormat (AudioFormat format) |
+Protected Attributes | |
+AudioFormat | mNativeFormat = AudioFormat::Invalid |
int64_t | mFramesWritten = 0 |
int64_t | mFramesRead = 0 |
![]() | |
AudioStreamCallback * | mStreamCallback = nullptr |
int32_t | mFramesPerCallback = kUnspecified |
int32_t | mChannelCount = kUnspecified |
int32_t | mSampleRate = kUnspecified |
int32_t | mDeviceId = kUnspecified |
int32_t | mBufferCapacityInFrames = kUnspecified |
int32_t | mBufferSizeInFrames = kUnspecified |
int32_t | mFramesPerBurst = kUnspecified |
SharingMode | mSharingMode = SharingMode::Shared |
AudioFormat | mFormat = AudioFormat::Unspecified |
Direction | mDirection = Direction::Output |
PerformanceMode | mPerformanceMode = PerformanceMode::None |
Usage | mUsage = Usage::Media |
ContentType | mContentType = ContentType::Music |
InputPreset | mInputPreset = InputPreset::VoiceRecognition |
SessionId | mSessionId = SessionId::None |
Base class for Oboe C++ audio stream.
+
+
|
+ +explicit | +
Construct an AudioStream
using the given AudioStreamBuilder
builder | containing all the stream's attributes |
+
|
+ +inlinevirtual | +
Calculate the latency of a stream based on getTimestamp().
+Output latency is the time it takes for a given frame to travel from the app to some type of digital-to-analog converter. If the DAC is external, for example in a USB interface or a TV connected by HDMI, then there may be additional latency that the Android device is unaware of.
+Input latency is the time it takes to a given frame to travel from an analog-to-digital converter (ADC) to the app.
+Note that the latency of an OUTPUT stream will increase abruptly when you write data to it and then decrease slowly over time as the data is consumed.
+The latency of an INPUT stream will decrease abruptly when you read data from it and then increase slowly over time as more data arrives.
+The latency of an OUTPUT stream is generally higher than the INPUT latency because an app generally tries to keep the OUTPUT buffer full and the INPUT buffer empty.
+
+
|
+ +pure virtual | +
Close the stream and deallocate any resources from the open() call.
+ +
+
|
+ +protected | +
Override this to provide your own behaviour for the audio callback
+audioData | container array which audio frames will be written into or read from |
numFrames | number of frames which were read/written |
+
|
+ +virtual | +
Flush the stream. This will block until the stream has been flushed, an error occurs or timeoutNanoseconds
has been reached.
+
|
+ +pure virtual | +
Get the underlying audio API which the stream uses.
+
+
|
+ +inline | +
Get the number of bytes in each audio frame. This is calculated using the channel count and the sample format. For example, a 2 channel floating point stream will have 2 * 4 = 8 bytes per frame.
+int32_t oboe::AudioStream::getBytesPerSample | +( | +) | +const | +
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.
+
+
|
+ +pure virtual | +
Query the number of frames that are read or written by the endpoint at one time.
+
+
|
+ +inlinevirtual | +
The number of audio frames read from the stream. This monotonic counter will never get reset.
+
+
|
+ +inlinevirtual | +
The number of audio frames written into the stream. This monotonic counter will never get reset.
+
+
|
+ +pure virtual | +
Query the current state, eg. StreamState::Pausing
+
+
|
+ +inlinevirtual | +
Get the estimated time that the frame at framePosition
entered or left the audio processing pipeline.
This can be used to coordinate events and interactions with the external environment, and to estimate the latency of an audio stream. An example of usage can be found in the hello-oboe sample (search for "calculateCurrentOutputLatencyMillis").
+The time is based on the implementation's best effort, using whatever knowledge is available to the system, but cannot account for any delay unknown to the implementation.
+clockId | the type of clock to use e.g. CLOCK_MONOTONIC |
framePosition | the frame number to query |
timeNanoseconds | an output parameter which will contain the presentation timestamp (if the operation is successful) |
+
|
+ +inlinevirtual | +
Only for debugging. Do not use in production. If you need to call this method something is wrong. If you think you need it for production then please let us know so we can modify Oboe so that you don't need this.
+
+
|
+ +inlinevirtual | +
An XRun is an Underrun or an Overrun. During playing, an underrun will occur if the stream is not written in time and the system runs out of valid data. During recording, an overrun will occur if the stream is not read in time and there is no place to put the incoming data so it is discarded.
+An underrun or overrun can cause an audible "pop" or "glitch".
+
+
|
+ +inlineprotectedvirtual | +
Increment the frames which have been read from this stream
+frames | number of frames to increment by |
+
|
+ +inlineprotectedvirtual | +
Increment the frames written to this stream
+frames | number of frames to increment by |
bool oboe::AudioStream::isPlaying | +( | +) | ++ |
Indicates whether the audio stream is playing.
+AudioStream::getState
.
+
|
+ +pure virtual | +
+
|
+ +inlineprotectedvirtual | +
Override this to provide a default for when the application did not specify a callback.
+audioData | |
numFrames |
+
|
+ +virtual | +
Open a stream based on the current settings.
+Note that we do not recommend re-opening a stream that has been closed. TODO Should we prevent re-opening?
+
+
|
+ +virtual | +
Pause the stream. This will block until the stream has been paused, an error occurs or timeoutNanoseconds
has been reached.
+
|
+ +inlinevirtual | +
Read data into the supplied buffer from the stream. This method will block until the read is complete or it runs out of time.
+If timeoutNanoseconds
is zero then this call will not wait.
buffer | The address of the first sample. |
numFrames | Number of frames to read. Only complete frames will be read. |
timeoutNanoseconds | Maximum number of nanoseconds to wait for completion. |
+
|
+ +pure virtual | +
Flush the stream asynchronously. Returns immediately (does not block). Equivalent to calling flush(0)
.
+
|
+ +pure virtual | +
Pause the stream asynchronously. Returns immediately (does not block). Equivalent to calling pause(0)
.
+
|
+ +pure virtual | +
Start the stream asynchronously. Returns immediately (does not block). Equivalent to calling start(0)
.
+
|
+ +pure virtual | +
Stop the stream asynchronously. Returns immediately (does not block). Equivalent to calling stop(0)
.
+
|
+ +inlinevirtual | +
This can be used to adjust the latency of the buffer by changing the threshold where blocking will occur. By combining this with getXRunCount(), the latency can be tuned at run-time for each device.
+This cannot be set higher than getBufferCapacity().
+requestedFrames | requested number of frames that can be filled without blocking |
+
|
+ +inlineprotectedvirtual | +
Used to set the format of the underlying stream
+ +
+
|
+ +virtual | +
Start the stream. This will block until the stream has been started, an error occurs or timeoutNanoseconds
has been reached.
+
|
+ +virtual | +
Stop the stream. This will block until the stream has been stopped, an error occurs or timeoutNanoseconds
has been reached.
+
|
+ +inline | +
Returns true if the underlying audio API is AAudio.
+
+
|
+ +pure virtual | +
Wait until the stream's current state no longer matches the input state. The input state is passed to avoid race conditions caused by the state changing between calls.
+Note that generally applications do not need to call this. It is considered an advanced technique.
+
+int64_t timeoutNanos = 500 * kNanosPerMillisecond; // arbitrary 1/2 second
+StreamState currentState = stream->getState();
+StreamState nextState = StreamState::Unknown;
+while (result == Result::OK && currentState != StreamState::Paused) {
+ result = stream->waitForStateChange(
+ currentState, &nextState, timeoutNanos);
+ currentState = nextState;
+}
+
inputState | The state we want to avoid. |
nextState | Pointer to a variable that will be set to the new state. |
timeoutNanoseconds | The maximum time to wait in nanoseconds. |
+
|
+ +protectedvirtual | +
Wait for a transition from one state to another.
+
|
+ +inlinevirtual | +
Write data from the supplied buffer into the stream. This method will block until the write is complete or it runs out of time.
+If timeoutNanoseconds
is zero then this call will not wait.
buffer | The address of the first sample. |
numFrames | Number of frames to write. Only complete frames will be written. |
timeoutNanoseconds | Maximum number of nanoseconds to wait for completion. |
+
|
+ +protected | +
Number of frames which have been read from the stream
+TODO these should be atomic like in AAudio
+ +
+
|
+ +protected | +
Number of frames which have been written into the stream
+TODO these should be atomic like in AAudio
+ +This is the complete list of members for oboe::AudioStreamBase, including all inherited members.
This is the complete list of members for oboe::AudioStreamBuilder, including all inherited members.
-#include <AudioStreamBase.h>
+Public Member Functions | |
AudioStreamBase (const AudioStreamBase &)=default | |
AudioStreamBase & | operator= (const AudioStreamBase &)=default |
int | getChannelCount () const |
Direction | getDirection () const |
int32_t | getSampleRate () const |
int | getFramesPerCallback () const |
AudioFormat | getFormat () const |
virtual int32_t | getBufferSizeInFrames () |
virtual int32_t | getBufferCapacityInFrames () const |
SharingMode | getSharingMode () const |
PerformanceMode | getPerformanceMode () const |
int32_t | getDeviceId () const |
AudioStreamCallback * | getCallback () const |
Usage | getUsage () const |
ContentType | getContentType () const |
InputPreset | getInputPreset () const |
SessionId | getSessionId () const |
+Protected Attributes | |
AudioStreamCallback * | mStreamCallback = nullptr |
int32_t | mFramesPerCallback = kUnspecified |
int32_t | mChannelCount = kUnspecified |
int32_t | mSampleRate = kUnspecified |
int32_t | mDeviceId = kUnspecified |
int32_t | mBufferCapacityInFrames = kUnspecified |
int32_t | mBufferSizeInFrames = kUnspecified |
int32_t | mFramesPerBurst = kUnspecified |
SharingMode | mSharingMode = SharingMode::Shared |
AudioFormat | mFormat = AudioFormat::Unspecified |
Direction | mDirection = Direction::Output |
PerformanceMode | mPerformanceMode = PerformanceMode::None |
Usage | mUsage = Usage::Media |
ContentType | mContentType = ContentType::Music |
InputPreset | mInputPreset = InputPreset::VoiceRecognition |
SessionId | mSessionId = SessionId::None |
Base class containing parameters for audio streams and builders.
+
+
|
+ +default | +
Default copy constructor
+ +
+
|
+ +inlinevirtual | +
+
|
+ +inlinevirtual | +
Query the maximum number of frames that can be filled without blocking. If the stream has been closed the last known value will be returned.
+
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +default | +
Default assignment operator
+ +
+
|
+ +protected | +
Stream buffer capacity specified as a number of audio frames
+ +
+
|
+ +protected | +
Stream buffer size specified as a number of audio frames
+ +
+
|
+ +protected | +
Stream channel count
+ +
+
|
+ +protected | +
Stream content type. Only active on Android 28+
+ +
+
|
+ +protected | +
Stream audio device ID
+ +
+
|
+ +protected | +
Stream direction
+ +
+
|
+ +protected | +
Format of audio frames
+ +
+
|
+ +protected | +
Number of frames which will be copied to/from the audio device in a single read/write operation
+ +
+
|
+ +protected | +
Number of audio frames which will be requested in each callback
+ +
+
|
+ +protected | +
Stream input preset. Only active on Android 28+
+ +
+
|
+ +protected | +
Stream performance mode
+ +
+
|
+ +protected | +
Stream sample rate
+ +
+
|
+ +protected | +
Stream session ID allocation strategy. Only active on Android 28+
+ +
+
|
+ +protected | +
Stream sharing mode
+ +
+
|
+ +protected | +
The callback which will be fired when new data is ready to be read/written
+ +
+
|
+ +protected | +
Stream usage. Only active on Android 28+
+ +This is the complete list of members for oboe::AudioStreamBuilder, including all inherited members.