Oboe 1.2 A library for creating real-time audio apps on Android

AudioStreamCallback.h
1 /*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef OBOE_STREAM_CALLBACK_H
18 #define OBOE_STREAM_CALLBACK_H
19
20 #include "oboe/Definitions.h"
21
22 namespace oboe {
23
24 class AudioStream;
25
33 class AudioStreamCallback {
34 public:
35 virtual ~AudioStreamCallback() = default;
36
83 virtual DataCallbackResult onAudioReady(
84 AudioStream *oboeStream,
85 void *audioData,
86 int32_t numFrames) = 0;
87
103 virtual void onErrorBeforeClose(AudioStream* /* oboeStream */, Result /* error */) {}
104
117 virtual void onErrorAfterClose(AudioStream* /* oboeStream */, Result /* error */) {}
118
119 };
120
121 } // namespace oboe
122
123 #endif //OBOE_STREAM_CALLBACK_H
oboe::AudioStreamCallback
Definition: AudioStreamCallback.h:33
oboe::DataCallbackResult
DataCallbackResult
Definition: Definitions.h:119
oboe::AudioStreamCallback::onAudioReady
virtual DataCallbackResult onAudioReady(AudioStream *oboeStream, void *audioData, int32_t numFrames)=0
oboe::AudioStream
Definition: AudioStream.h:44
oboe::AudioStreamCallback::onErrorAfterClose
virtual void onErrorAfterClose(AudioStream *, Result)
Definition: AudioStreamCallback.h:117
oboe::AudioStreamCallback::onErrorBeforeClose
virtual void onErrorBeforeClose(AudioStream *, Result)
Definition: AudioStreamCallback.h:103
oboe::Result
Result
Definition: Definitions.h:131
oboe
Definition: AudioStream.h:31