Skip to content

Commit 8cbb963

Browse files
committed
Arduino compile and linker errors
1 parent df0ac65 commit 8cbb963

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+4463
-11
lines changed

library.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name=codec2
2+
version=1.0.3
3+
author=David Grant Rowe,
4+
maintainer=Phil Schatzmann <phil.schatzmann@gmail.com>
5+
sentence=codec2 - low-bitrate speech audio codec
6+
category=Signal Input/Output
7+
url=https://github.com/pschatzmann/arduino-codec2
8+
architectures=*

src/c2dec.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
99
\*---------------------------------------------------------------------------*/
1010

11+
#ifndef ARDUINO
12+
1113
/*
1214
Copyright (C) 2010 David Rowe
1315
@@ -429,3 +431,5 @@ void print_help(const struct option* long_options, int num_opts, char* argv[])
429431
}
430432
exit(1);
431433
}
434+
435+
#endif

src/c2enc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
of bits.
99
1010
\*---------------------------------------------------------------------------*/
11-
11+
#ifndef ARDUINO
1212
/*
1313
Copyright (C) 2010 David Rowe
1414
@@ -199,3 +199,5 @@ int main(int argc, char *argv[])
199199

200200
return 0;
201201
}
202+
203+
#endif

src/c2sim.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
for algorithm development.
1010
1111
\*---------------------------------------------------------------------------*/
12-
12+
#ifndef ARDUINO
1313
/*
1414
Copyright (C) 2009 David Rowe
1515
@@ -1166,3 +1166,5 @@ void print_help(const struct option* long_options, int num_opts, char* argv[])
11661166

11671167
exit(1);
11681168
}
1169+
1170+
#endif

src/ch.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
99
\*---------------------------------------------------------------------------*/
1010

11+
#ifndef ARDUINO
12+
1113
/*
1214
Copyright (C) 2015-2022 David Rowe
1315
@@ -472,3 +474,5 @@ int main(int argc, char *argv[])
472474
}
473475
else return 0;
474476
}
477+
478+
#endif

src/codebook/codebook.c

Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
1+
/* THIS IS A GENERATED FILE. Edit generate_codebook.c and its input */
2+
3+
/*
4+
* This intermediary file and the files that used to create it are under
5+
* The LGPL. See the file COPYING.
6+
*/
7+
8+
#include "defines.h"
9+
10+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp1.txt */
11+
#if defined(__EMBEDDED__) || defined(ARDUINO)
12+
static const float codes0[] = {
13+
#else
14+
static float codes0[] = {
15+
#endif
16+
225,
17+
250,
18+
275,
19+
300,
20+
325,
21+
350,
22+
375,
23+
400,
24+
425,
25+
450,
26+
475,
27+
500,
28+
525,
29+
550,
30+
575,
31+
600
32+
};
33+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp2.txt */
34+
#if defined(__EMBEDDED__) || defined(ARDUINO)
35+
static const float codes1[] = {
36+
#else
37+
static float codes1[] = {
38+
#endif
39+
325,
40+
350,
41+
375,
42+
400,
43+
425,
44+
450,
45+
475,
46+
500,
47+
525,
48+
550,
49+
575,
50+
600,
51+
625,
52+
650,
53+
675,
54+
700
55+
};
56+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp3.txt */
57+
#if defined(__EMBEDDED__) || defined(ARDUINO)
58+
static const float codes2[] = {
59+
#else
60+
static float codes2[] = {
61+
#endif
62+
500,
63+
550,
64+
600,
65+
650,
66+
700,
67+
750,
68+
800,
69+
850,
70+
900,
71+
950,
72+
1000,
73+
1050,
74+
1100,
75+
1150,
76+
1200,
77+
1250
78+
};
79+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp4.txt */
80+
#if defined(__EMBEDDED__) || defined(ARDUINO)
81+
static const float codes3[] = {
82+
#else
83+
static float codes3[] = {
84+
#endif
85+
700,
86+
800,
87+
900,
88+
1000,
89+
1100,
90+
1200,
91+
1300,
92+
1400,
93+
1500,
94+
1600,
95+
1700,
96+
1800,
97+
1900,
98+
2000,
99+
2100,
100+
2200
101+
};
102+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp5.txt */
103+
#if defined(__EMBEDDED__) || defined(ARDUINO)
104+
static const float codes4[] = {
105+
#else
106+
static float codes4[] = {
107+
#endif
108+
950,
109+
1050,
110+
1150,
111+
1250,
112+
1350,
113+
1450,
114+
1550,
115+
1650,
116+
1750,
117+
1850,
118+
1950,
119+
2050,
120+
2150,
121+
2250,
122+
2350,
123+
2450
124+
};
125+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp6.txt */
126+
#if defined(__EMBEDDED__) || defined(ARDUINO)
127+
static const float codes5[] = {
128+
#else
129+
static float codes5[] = {
130+
#endif
131+
1100,
132+
1200,
133+
1300,
134+
1400,
135+
1500,
136+
1600,
137+
1700,
138+
1800,
139+
1900,
140+
2000,
141+
2100,
142+
2200,
143+
2300,
144+
2400,
145+
2500,
146+
2600
147+
};
148+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp7.txt */
149+
#if defined(__EMBEDDED__) || defined(ARDUINO)
150+
static const float codes6[] = {
151+
#else
152+
static float codes6[] = {
153+
#endif
154+
1500,
155+
1600,
156+
1700,
157+
1800,
158+
1900,
159+
2000,
160+
2100,
161+
2200,
162+
2300,
163+
2400,
164+
2500,
165+
2600,
166+
2700,
167+
2800,
168+
2900,
169+
3000
170+
};
171+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp8.txt */
172+
#if defined(__EMBEDDED__) || defined(ARDUINO)
173+
static const float codes7[] = {
174+
#else
175+
static float codes7[] = {
176+
#endif
177+
2300,
178+
2400,
179+
2500,
180+
2600,
181+
2700,
182+
2800,
183+
2900,
184+
3000
185+
};
186+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp9.txt */
187+
#if defined(__EMBEDDED__) || defined(ARDUINO)
188+
static const float codes8[] = {
189+
#else
190+
static float codes8[] = {
191+
#endif
192+
2500,
193+
2600,
194+
2700,
195+
2800,
196+
2900,
197+
3000,
198+
3100,
199+
3200
200+
};
201+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp10.txt */
202+
#if defined(__EMBEDDED__) || defined(ARDUINO)
203+
static const float codes9[] = {
204+
#else
205+
static float codes9[] = {
206+
#endif
207+
2900,
208+
3100,
209+
3300,
210+
3500
211+
};
212+
213+
const struct lsp_codebook lsp_cb[] = {
214+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp1.txt */
215+
{
216+
1,
217+
4,
218+
16,
219+
codes0
220+
},
221+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp2.txt */
222+
{
223+
1,
224+
4,
225+
16,
226+
codes1
227+
},
228+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp3.txt */
229+
{
230+
1,
231+
4,
232+
16,
233+
codes2
234+
},
235+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp4.txt */
236+
{
237+
1,
238+
4,
239+
16,
240+
codes3
241+
},
242+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp5.txt */
243+
{
244+
1,
245+
4,
246+
16,
247+
codes4
248+
},
249+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp6.txt */
250+
{
251+
1,
252+
4,
253+
16,
254+
codes5
255+
},
256+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp7.txt */
257+
{
258+
1,
259+
4,
260+
16,
261+
codes6
262+
},
263+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp8.txt */
264+
{
265+
1,
266+
3,
267+
8,
268+
codes7
269+
},
270+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp9.txt */
271+
{
272+
1,
273+
3,
274+
8,
275+
codes8
276+
},
277+
/* /Users/pschatzmann/Dev/Arduino/libraries/arduino-codec2/src/codebook/lsp10.txt */
278+
{
279+
1,
280+
2,
281+
4,
282+
codes9
283+
},
284+
{ 0, 0, 0, 0 }
285+
};

0 commit comments

Comments
 (0)