Oboe
A library for creating real-time audio apps on Android
Loading...
Searching...
No Matches
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
22namespace oboe {
23
24class AudioStream;
25
35public:
36 virtual ~AudioStreamDataCallback() = default;
37
85 AudioStream *audioStream,
86 void *audioData,
87 int32_t numFrames) = 0;
88};
89
102public:
103 virtual ~AudioStreamErrorCallback() = default;
104
131 virtual bool onError(AudioStream* /* audioStream */, Result /* error */) {
132 return false;
133 }
134
151 virtual void onErrorBeforeClose(AudioStream* /* audioStream */, Result /* error */) {}
152
167 virtual void onErrorAfterClose(AudioStream* /* audioStream */, Result /* error */) {}
168
169};
170
187public:
188 virtual ~AudioStreamCallback() = default;
189};
190
191} // namespace oboe
192
193#endif //OBOE_STREAM_CALLBACK_H
Definition: AudioStreamCallback.h:186
Definition: AudioStreamCallback.h:34
virtual DataCallbackResult onAudioReady(AudioStream *audioStream, void *audioData, int32_t numFrames)=0
Definition: AudioStreamCallback.h:101
virtual void onErrorBeforeClose(AudioStream *, Result)
Definition: AudioStreamCallback.h:151
virtual bool onError(AudioStream *, Result)
Definition: AudioStreamCallback.h:131
virtual void onErrorAfterClose(AudioStream *, Result)
Definition: AudioStreamCallback.h:167
Definition: AudioStream.h:44
Definition: AudioStream.h:31
Result
Definition: Definitions.h:157
DataCallbackResult
Definition: Definitions.h:145