Skip to content

Commit 1951a6c

Browse files
committed
2 parents 7324b90 + cce80c8 commit 1951a6c

File tree

3 files changed

+83
-58
lines changed

3 files changed

+83
-58
lines changed

CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
3+
# set the project name
4+
project(arduino_libopus)
5+
6+
# lots of warnings and all warnings as errors
7+
## add_compile_options(-Wall -Wextra )
8+
set(CMAKE_CXX_STANDARD 17)
9+
10+
file(GLOB_RECURSE SRC_LIST_C CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/src/*.c" )
11+
12+
# define libraries
13+
add_library (arduino_libopus ${SRC_LIST_C})
14+
15+
# prevent compile errors
16+
target_compile_options(arduino_libopus PRIVATE -DARDUINO)
17+
18+
19+
# define location for header files
20+
target_include_directories(arduino_libopus PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src )
21+

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ git clone https://github.com/pschatzmann/arduino-libopus.git
3737
3838
```
3939

40+
## Usage
41+
42+
I recommend to use this library together with the [arduino-audio-tools](https://github.com/pschatzmann/arduino-audio-tools). Further information can be found in the [Wiki of the audio-tools](https://github.com/pschatzmann/arduino-audio-tools/wiki/Encoding-and-Decoding-of-Audio)!
43+
4044
## Design
4145

4246
In order to create an Arduino compatible library I executed the following steps:

src/opus_config.h

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,35 @@
1313
/* Do not build the float API */
1414
#define DISABLE_FLOAT_API 1
1515

16-
/* Disable bitstream fixes from RFC 8251 */
17-
#undef DISABLE_UPDATE_DRAFT
16+
// /* Disable bitstream fixes from RFC 8251 */
17+
// #undef DISABLE_UPDATE_DRAFT
1818

1919
/* Assertions */
2020
#define ENABLE_ASSERTIONS 1
2121

22-
/* Hardening */
23-
#undef ENABLE_HARDENING
22+
// /* Hardening */
23+
// #undef ENABLE_HARDENING
2424

25-
/* Debug fixed-point implementation */
26-
#undef FIXED_DEBUG
25+
// /* Debug fixed-point implementation */
26+
// #undef FIXED_DEBUG
2727

2828
/* Compile as fixed-point (for machines without a fast enough FPU) */
2929
#define FIXED_POINT 1
3030

31-
/* Float approximations */
32-
#undef FLOAT_APPROX
31+
// /* Float approximations */
32+
// #undef FLOAT_APPROX
3333

34-
/* Fuzzing */
35-
#undef FUZZING
34+
// /* Fuzzing */
35+
// #undef FUZZING
3636

37-
/* Define to 1 if you have the <alloca.h> header file. */
38-
#undef HAVE_ALLOCA_H
37+
// /* Define to 1 if you have the <alloca.h> header file. */
38+
// #undef HAVE_ALLOCA_H
3939

40-
/* NE10 library is installed on host. Make sure it is on target! */
41-
#undef HAVE_ARM_NE10
40+
// /* NE10 library is installed on host. Make sure it is on target! */
41+
// #undef HAVE_ARM_NE10
4242

43-
/* Define to 1 if you have the <dlfcn.h> header file. */
44-
#undef HAVE_DLFCN_H
43+
// /* Define to 1 if you have the <dlfcn.h> header file. */
44+
// #undef HAVE_DLFCN_H
4545

4646
/* Define to 1 if you have the <inttypes.h> header file. */
4747
#define HAVE_INTTYPES_H 1
@@ -61,26 +61,26 @@
6161
/* Define to 1 if you have the <stdlib.h> header file. */
6262
#define HAVE_STDLIB_H 1
6363

64-
/* Define to 1 if you have the <strings.h> header file. */
65-
#undef HAVE_STRINGS_H
64+
// /* Define to 1 if you have the <strings.h> header file. */
65+
// #undef HAVE_STRINGS_H
6666

67-
/* Define to 1 if you have the <string.h> header file. */
68-
#undef HAVE_STRING_H
67+
// /* Define to 1 if you have the <string.h> header file. */
68+
// #undef HAVE_STRING_H
6969

70-
/* Define to 1 if you have the <sys/stat.h> header file. */
71-
#undef HAVE_SYS_STAT_H
70+
// /* Define to 1 if you have the <sys/stat.h> header file. */
71+
// #undef HAVE_SYS_STAT_H
7272

73-
/* Define to 1 if you have the <sys/types.h> header file. */
74-
#undef HAVE_SYS_TYPES_H
73+
// /* Define to 1 if you have the <sys/types.h> header file. */
74+
// #undef HAVE_SYS_TYPES_H
7575

76-
/* Define to 1 if you have the <unistd.h> header file. */
77-
#undef HAVE_UNISTD_H
76+
// /* Define to 1 if you have the <unistd.h> header file. */
77+
// #undef HAVE_UNISTD_H
7878

79-
/* Define to 1 if you have the `__malloc_hook' function. */
80-
#undef HAVE___MALLOC_HOOK
79+
// /* Define to 1 if you have the `__malloc_hook' function. */
80+
// #undef HAVE___MALLOC_HOOK
8181

82-
/* Define to the sub-directory where libtool stores uninstalled libraries. */
83-
#undef LT_OBJDIR
82+
// /* Define to the sub-directory where libtool stores uninstalled libraries. */
83+
// #undef LT_OBJDIR
8484

8585
// /* Make use of ARM asm optimization */
8686
// #undef OPUS_ARM_ASM
@@ -178,44 +178,44 @@
178178
// /* Define to 1 if you have the ANSI C header files. */
179179
// #undef STDC_HEADERS
180180

181-
/* Make use of alloca */
182-
#undef USE_ALLOCA
181+
// /* Make use of alloca */
182+
// #undef USE_ALLOCA
183183

184-
/* Use C99 variable-size arrays */
185-
#undef VAR_ARRAYS
184+
// /* Use C99 variable-size arrays */
185+
// #undef VAR_ARRAYS
186186

187187
/* Simulated Stack using the Heap */
188188
#define NONTHREADSAFE_PSEUDOSTACK 1
189189

190190
/* Simulated Stack Size using the Heap */
191191
#define GLOBAL_STACK_SIZE 60000
192192

193-
/* Define to empty if `const' does not conform to ANSI C. */
194-
#undef const
195-
196-
/* Define to `__inline__' or `__inline' if that's what the C compiler
197-
calls it, or to nothing if 'inline' is not supported under any name. */
198-
#ifndef __cplusplus
199-
#undef inline
200-
#endif
201-
202-
/* Define to the equivalent of the C99 'restrict' keyword, or to
203-
nothing if this is not supported. Do not define if restrict is
204-
supported directly. */
205-
#undef restrict
206-
/* Work around a bug in Sun C++: it does not support _Restrict or
207-
__restrict__, even though the corresponding Sun C compiler ends up with
208-
"#define restrict _Restrict" or "#define restrict __restrict__" in the
209-
previous line. Perhaps some future version of Sun C++ will work with
210-
restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
211-
#if defined __SUNPRO_CC && !defined __RESTRICT
212-
# define _Restrict
213-
# define __restrict__
214-
#endif
193+
// /* Define to empty if `const' does not conform to ANSI C. */
194+
// #undef const
195+
196+
// /* Define to `__inline__' or `__inline' if that's what the C compiler
197+
// calls it, or to nothing if 'inline' is not supported under any name. */
198+
// #ifndef __cplusplus
199+
// #undef inline
200+
// #endif
201+
202+
// /* Define to the equivalent of the C99 'restrict' keyword, or to
203+
// nothing if this is not supported. Do not define if restrict is
204+
// supported directly. */
205+
// #undef restrict
206+
// /* Work around a bug in Sun C++: it does not support _Restrict or
207+
// __restrict__, even though the corresponding Sun C compiler ends up with
208+
// "#define restrict _Restrict" or "#define restrict __restrict__" in the
209+
// previous line. Perhaps some future version of Sun C++ will work with
210+
// restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
211+
// #if defined __SUNPRO_CC && !defined __RESTRICT
212+
// # define _Restrict
213+
// # define __restrict__
214+
// #endif
215215

216216

217217
/* Do not build reading support */
218-
#define OGGZ_CONFIG_READ 0
218+
#define OGGZ_CONFIG_READ 1
219219

220220
/* Do not build writing support */
221-
#define OGGZ_CONFIG_WRITE 0
221+
#define OGGZ_CONFIG_WRITE 1

0 commit comments

Comments
 (0)