Skip to content

Commit 2841a01

Browse files
committed
podspec lint issues: add iOS Simulator support for ESpeakNG framework
• Added iOS Simulator support - Created complete ios-arm64_x86_64-simulator slice with stub framework for CocoaPods compatibility • Updated documentation - Revised EspeakFramework.md to reflect current iOS Simulator support via stub framework approach
1 parent a79c8b1 commit 2841a01

525 files changed

Lines changed: 5980 additions & 1 deletion

File tree

Some content is hidden

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

Documentation/EspeakFramework.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ FluidAudio bundles the eSpeak-NG phoneme resources so Kokoro can fall back to G2
1717
- If you customize the cache location, be sure the `Resources/espeak-ng/espeak-ng-data.bundle/voices/` directory is present before running TTS.
1818
- When testing on iOS, bundle the extracted resources with the app or seed the simulator cache in advance to avoid runtime failures.
1919

20+
## CocoaPods integration notes
21+
- The `ESpeakNG.xcframework` now includes support for iOS device (arm64), iOS Simulator (arm64 + x86_64), and macOS (arm64 + x86_64).
22+
- iOS Simulator support is provided via a stub framework that allows building and linking but returns failure values for ESpeakNG function calls.
23+
- Pod validation passes successfully with `pod lib lint FluidAudio.podspec --allow-warnings` for all platforms.
24+
- On iOS Simulator, ESpeakNG initialization will fail gracefully and phonemization requests will return `nil` due to the stub implementation.
25+
- Full ESpeakNG functionality is available on iOS device and macOS platforms.
26+
2027
## Licensing notes
2128
- eSpeak-NG is distributed under the GNU GPL v3 (or later). Both the core library and the `espeak-ng-data` voices inherit the same license.
2229
- The full license text now lives at `Licenses/ESpeakNG_LICENSE.txt`; ship this file (or the upstream `COPYING`) anywhere the framework is redistributed and surface it in your third-party notices UI.

FluidAudio.podspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Pod::Spec.new do |spec|
1919
spec.source = { :git => "https://github.com/FluidInference/FluidAudio.git", :tag => "v#{spec.version}" }
2020
spec.source_files = "Sources/FluidAudio/**/*.swift"
2121
spec.vendored_frameworks = "Sources/FluidAudio/Frameworks/ESpeakNG.xcframework"
22-
spec.resources = "Sources/FluidAudio/Frameworks/ESpeakNG.xcframework/**/espeak-ng-data.bundle"
2322

2423
spec.swift_versions = ["5.10"]
2524
spec.frameworks = "CoreML", "AVFoundation", "Accelerate"

Sources/FluidAudio/Frameworks/ESpeakNG.xcframework/Info.plist

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@
3333
<key>SupportedPlatform</key>
3434
<string>ios</string>
3535
</dict>
36+
<dict>
37+
<key>BinaryPath</key>
38+
<string>ESpeakNG.framework/ESpeakNG</string>
39+
<key>LibraryIdentifier</key>
40+
<string>ios-arm64_x86_64-simulator</string>
41+
<key>LibraryPath</key>
42+
<string>ESpeakNG.framework</string>
43+
<key>SupportedArchitectures</key>
44+
<array>
45+
<string>arm64</string>
46+
<string>x86_64</string>
47+
</array>
48+
<key>SupportedPlatform</key>
49+
<string>ios</string>
50+
<key>SupportedPlatformVariant</key>
51+
<string>simulator</string>
52+
</dict>
3653
</array>
3754
<key>CFBundlePackageType</key>
3855
<string>XFWK</string>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include <ESpeakNG/speak_lib.h>
2+
#include <ESpeakNG/espeak_ng.h>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include <ESpeakNG/speak_lib.h>
2+
#include <ESpeakNG/espeak_ng.h>
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
/* eSpeak NG API.
2+
*
3+
* Copyright (C) 2015-2017 Reece H. Dunn
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
#ifndef ESPEAK_NG_H
20+
#define ESPEAK_NG_H
21+
22+
#include <ESpeakNG/speak_lib.h>
23+
24+
#ifdef __cplusplus
25+
extern "C"
26+
{
27+
#endif
28+
29+
#if defined(_WIN32) || defined(_WIN64)
30+
#ifdef LIBESPEAK_NG_EXPORT
31+
#define ESPEAK_NG_API __declspec(dllexport)
32+
#else
33+
#define ESPEAK_NG_API __declspec(dllimport)
34+
#endif
35+
#else
36+
#define ESPEAK_NG_API
37+
#endif
38+
39+
#define ESPEAKNG_DEFAULT_VOICE "en"
40+
41+
typedef enum {
42+
ENS_GROUP_MASK = 0x70000000,
43+
ENS_GROUP_ERRNO = 0x00000000, /* Values 0-255 map to errno error codes. */
44+
ENS_GROUP_ESPEAK_NG = 0x10000000, /* eSpeak NG error codes. */
45+
46+
/* eSpeak NG 1.49.0 */
47+
ENS_OK = 0,
48+
ENS_COMPILE_ERROR = 0x100001FF,
49+
ENS_VERSION_MISMATCH = 0x100002FF,
50+
ENS_FIFO_BUFFER_FULL = 0x100003FF,
51+
ENS_NOT_INITIALIZED = 0x100004FF,
52+
ENS_AUDIO_ERROR = 0x100005FF,
53+
ENS_VOICE_NOT_FOUND = 0x100006FF,
54+
ENS_MBROLA_NOT_FOUND = 0x100007FF,
55+
ENS_MBROLA_VOICE_NOT_FOUND = 0x100008FF,
56+
ENS_EVENT_BUFFER_FULL = 0x100009FF,
57+
ENS_NOT_SUPPORTED = 0x10000AFF,
58+
ENS_UNSUPPORTED_PHON_FORMAT = 0x10000BFF,
59+
ENS_NO_SPECT_FRAMES = 0x10000CFF,
60+
ENS_EMPTY_PHONEME_MANIFEST = 0x10000DFF,
61+
ENS_SPEECH_STOPPED = 0x10000EFF,
62+
63+
/* eSpeak NG 1.49.2 */
64+
ENS_UNKNOWN_PHONEME_FEATURE = 0x10000FFF,
65+
ENS_UNKNOWN_TEXT_ENCODING = 0x100010FF,
66+
} espeak_ng_STATUS;
67+
68+
typedef enum {
69+
ENOUTPUT_MODE_SYNCHRONOUS = 0x0001,
70+
ENOUTPUT_MODE_SPEAK_AUDIO = 0x0002,
71+
} espeak_ng_OUTPUT_MODE;
72+
73+
typedef enum {
74+
ENGENDER_UNKNOWN = 0,
75+
ENGENDER_MALE = 1,
76+
ENGENDER_FEMALE = 2,
77+
ENGENDER_NEUTRAL = 3,
78+
} espeak_ng_VOICE_GENDER;
79+
80+
typedef struct
81+
{
82+
void (*outputPhoSymbol)(char* pho_code,int pho_type);
83+
void (*outputSilence)(short echo_tail);
84+
void (*outputVoiced)(short sample);
85+
void (*outputUnvoiced)(short sample);
86+
} espeak_ng_OUTPUT_HOOKS;
87+
88+
/* eSpeak NG 1.49.0 */
89+
90+
typedef struct espeak_ng_ERROR_CONTEXT_ *espeak_ng_ERROR_CONTEXT;
91+
92+
ESPEAK_NG_API void
93+
espeak_ng_ClearErrorContext(espeak_ng_ERROR_CONTEXT *context);
94+
95+
ESPEAK_NG_API void
96+
espeak_ng_GetStatusCodeMessage(espeak_ng_STATUS status,
97+
char *buffer,
98+
size_t length);
99+
100+
ESPEAK_NG_API void
101+
espeak_ng_PrintStatusCodeMessage(espeak_ng_STATUS status,
102+
FILE *out,
103+
espeak_ng_ERROR_CONTEXT context);
104+
105+
ESPEAK_NG_API void
106+
espeak_ng_InitializePath(const char *path);
107+
108+
ESPEAK_NG_API espeak_ng_STATUS
109+
espeak_ng_Initialize(espeak_ng_ERROR_CONTEXT *context);
110+
111+
ESPEAK_NG_API espeak_ng_STATUS
112+
espeak_ng_InitializeOutput(espeak_ng_OUTPUT_MODE output_mode,
113+
int buffer_length,
114+
const char *device);
115+
116+
ESPEAK_NG_API int
117+
espeak_ng_GetSampleRate(void);
118+
119+
ESPEAK_NG_API espeak_ng_STATUS
120+
espeak_ng_SetParameter(espeak_PARAMETER parameter,
121+
int value,
122+
int relative);
123+
124+
ESPEAK_NG_API espeak_ng_STATUS
125+
espeak_ng_SetPhonemeEvents(int enable, int ipa);
126+
127+
ESPEAK_NG_API espeak_ng_STATUS
128+
espeak_ng_SetPunctuationList(const wchar_t *punctlist);
129+
130+
ESPEAK_NG_API espeak_ng_STATUS
131+
espeak_ng_SetVoiceByName(const char *name);
132+
133+
ESPEAK_NG_API espeak_ng_STATUS
134+
espeak_ng_SetVoiceByFile(const char *filename);
135+
136+
ESPEAK_NG_API espeak_ng_STATUS
137+
espeak_ng_SetVoiceByProperties(espeak_VOICE *voice_selector);
138+
139+
ESPEAK_NG_API espeak_ng_STATUS
140+
espeak_ng_Synthesize(const void *text,
141+
size_t size,
142+
unsigned int position,
143+
espeak_POSITION_TYPE position_type,
144+
unsigned int end_position,
145+
unsigned int flags,
146+
unsigned int *unique_identifier,
147+
void *user_data);
148+
149+
ESPEAK_NG_API espeak_ng_STATUS
150+
espeak_ng_SynthesizeMark(const void *text,
151+
size_t size,
152+
const char *index_mark,
153+
unsigned int end_position,
154+
unsigned int flags,
155+
unsigned int *unique_identifier,
156+
void *user_data);
157+
158+
ESPEAK_NG_API espeak_ng_STATUS
159+
espeak_ng_SpeakKeyName(const char *key_name);
160+
161+
ESPEAK_NG_API espeak_ng_STATUS
162+
espeak_ng_SpeakCharacter(wchar_t character);
163+
164+
ESPEAK_NG_API espeak_ng_STATUS
165+
espeak_ng_Cancel(void);
166+
167+
ESPEAK_NG_API espeak_ng_STATUS
168+
espeak_ng_Synchronize(void);
169+
170+
ESPEAK_NG_API espeak_ng_STATUS
171+
espeak_ng_Terminate(void);
172+
173+
ESPEAK_NG_API espeak_ng_STATUS
174+
espeak_ng_CompileDictionary(const char *dsource,
175+
const char *dict_name,
176+
FILE *log,
177+
int flags,
178+
espeak_ng_ERROR_CONTEXT *context);
179+
180+
ESPEAK_NG_API espeak_ng_STATUS
181+
espeak_ng_CompileMbrolaVoice(const char *path,
182+
FILE *log,
183+
espeak_ng_ERROR_CONTEXT *context);
184+
185+
ESPEAK_NG_API espeak_ng_STATUS
186+
espeak_ng_CompilePhonemeData(long rate,
187+
FILE *log,
188+
espeak_ng_ERROR_CONTEXT *context);
189+
190+
ESPEAK_NG_API espeak_ng_STATUS
191+
espeak_ng_CompileIntonation(FILE *log,
192+
espeak_ng_ERROR_CONTEXT *context);
193+
194+
195+
ESPEAK_NG_API espeak_ng_STATUS
196+
espeak_ng_CompileIntonationPath(const char *source_path,
197+
const char *destination_path,
198+
FILE *log,
199+
espeak_ng_ERROR_CONTEXT *context);
200+
201+
/* eSpeak NG 1.49.1 */
202+
203+
ESPEAK_NG_API espeak_ng_STATUS
204+
espeak_ng_CompilePhonemeDataPath(long rate,
205+
const char *source_path,
206+
const char *destination_path,
207+
FILE *log,
208+
espeak_ng_ERROR_CONTEXT *context);
209+
210+
ESPEAK_NG_API espeak_ng_STATUS
211+
espeak_ng_SetOutputHooks(espeak_ng_OUTPUT_HOOKS* hooks);
212+
ESPEAK_NG_API espeak_ng_STATUS
213+
espeak_ng_SetConstF0(int f0);
214+
215+
ESPEAK_NG_API espeak_ng_STATUS
216+
espeak_ng_SetRandSeed(long seed);
217+
218+
219+
#ifdef __cplusplus
220+
}
221+
#endif
222+
223+
#endif

0 commit comments

Comments
 (0)