Oboe  1.5
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 <string>
23 #include "oboe/Definitions.h"
24 
25 namespace oboe {
26 
34 void convertFloatToPcm16(const float *source, int16_t *destination, int32_t numSamples);
35 
43 void convertPcm16ToFloat(const int16_t *source, float *destination, int32_t numSamples);
44 
49 
59 template <typename FromType>
60 const char * convertToText(FromType input);
61 
66 std::string getPropertyString(const char * name);
67 
73 int getPropertyInteger(const char * name, int defaultValue);
74 
83 int getSdkVersion();
84 
85 } // namespace oboe
86 
87 #endif //OBOE_UTILITIES_H
void convertFloatToPcm16(const float *source, int16_t *destination, int32_t numSamples)
const char * convertToText(FromType input)
std::string getPropertyString(const char *name)
int getPropertyInteger(const char *name, int defaultValue)
void convertPcm16ToFloat(const int16_t *source, float *destination, int32_t numSamples)
AudioFormat
Definition: Definitions.h:94
int32_t convertFormatToSizeInBytes(AudioFormat format)
Definition: AudioStream.h:31
int getSdkVersion()