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

Utilities.h
1 /*
2 * Copyright 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_UTILITIES_H
18 #define OBOE_UTILITIES_H
19
20 #include <unistd.h>
21 #include <sys/types.h>
22 #include "oboe/Definitions.h"
23
24 namespace oboe {
25
33 void convertFloatToPcm16(const float *source, int16_t *destination, int32_t numSamples);
34
42 void convertPcm16ToFloat(const int16_t *source, float *destination, int32_t numSamples);
43
47 int32_t convertFormatToSizeInBytes(AudioFormat format);
48
58 template <typename FromType>
59 const char * convertToText(FromType input);
60
69 int getSdkVersion();
70
71 } // namespace oboe
72
73 #endif //OBOE_UTILITIES_H
oboe::convertFloatToPcm16
void convertFloatToPcm16(const float *source, int16_t *destination, int32_t numSamples)
oboe::convertToText
const char * convertToText(FromType input)
oboe::convertPcm16ToFloat
void convertPcm16ToFloat(const int16_t *source, float *destination, int32_t numSamples)
oboe::AudioFormat
AudioFormat
Definition: Definitions.h:94
oboe::convertFormatToSizeInBytes
int32_t convertFormatToSizeInBytes(AudioFormat format)
oboe
Definition: AudioStream.h:31
oboe::getSdkVersion
int getSdkVersion()