| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9d7f40b commit 1cb8e48
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,6 +31,11 @@ | |||
| 31 | 31 | /* End PBXContainerItemProxy section */ | |
| 32 | 32 | ||
| 33 | 33 | /* Begin PBXFileReference section */ | |
| 34 | + 4D7113541991129F00C1710F /* w32sapi4speech.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = w32sapi4speech.cpp; path = src/w32sapi4speech.cpp; sourceTree = "<group>"; }; | ||
| 35 | + 4D7113551991129F00C1710F /* w32sapi4speech.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = w32sapi4speech.h; path = src/w32sapi4speech.h; sourceTree = "<group>"; }; | ||
| 36 | + 4D7113561991129F00C1710F /* w32sapi5speech.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = w32sapi5speech.cpp; path = src/w32sapi5speech.cpp; sourceTree = "<group>"; }; | ||
| 37 | + 4D7113571991129F00C1710F /* w32sapi5speech.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = w32sapi5speech.h; path = src/w32sapi5speech.h; sourceTree = "<group>"; }; | ||
| 38 | + 4D7113581991129F00C1710F /* w32speech.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = w32speech.cpp; path = src/w32speech.cpp; sourceTree = "<group>"; }; | ||
| 34 | 39 | E82D44A11713199700A10289 /* revspeech.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = revspeech.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| 35 | 40 | E82D44B217131A4800A10289 /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = ../rules/Debug.xcconfig; sourceTree = "<group>"; }; | |
| 36 | 41 | E82D44B317131A4800A10289 /* Global.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Global.xcconfig; path = ../rules/Global.xcconfig; sourceTree = "<group>"; }; | |
@@ -106,6 +111,11 @@ | |||
| 106 | 111 | E82D44B917131B3500A10289 /* Source */ = { | |
| 107 | 112 | isa = PBXGroup; | |
| 108 | 113 | children = ( | |
| 114 | + 4D7113541991129F00C1710F /* w32sapi4speech.cpp */, | ||
| 115 | + 4D7113551991129F00C1710F /* w32sapi4speech.h */, | ||
| 116 | + 4D7113561991129F00C1710F /* w32sapi5speech.cpp */, | ||
| 117 | + 4D7113571991129F00C1710F /* w32sapi5speech.h */, | ||
| 118 | + 4D7113581991129F00C1710F /* w32speech.cpp */, | ||
| 109 | 119 | E82D44BA17131B4700A10289 /* osxspeech.cpp */, | |
| 110 | 120 | E82D44BB17131B4700A10289 /* osxspeech.h */, | |
| 111 | 121 | E82D44BC17131B4700A10289 /* revspeech.cpp */, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -64,7 +64,7 @@ bool OSXSpeechNarrator::Finalize(void) | |||
| 64 | 64 | return false; | |
| 65 | 65 | } | |
| 66 | 66 | ||
| 67 | - bool OSXSpeechNarrator::Start(const char* p_string) | ||
| 67 | + bool OSXSpeechNarrator::Start(const char* p_string, bool p_is_utf8) | ||
| 68 | 68 | { | |
| 69 | 69 | if (SpeechStart(true) == false) | |
| 70 | 70 | { | |
@@ -73,7 +73,7 @@ bool OSXSpeechNarrator::Start(const char* p_string) | |||
| 73 | 73 | ||
| 74 | 74 | if (speechtext != nil) | |
| 75 | 75 | CFRelease(speechtext); | |
| 76 | - speechtext = CFStringCreateWithCString(kCFAllocatorDefault, p_string, kCFStringEncodingMacRoman); | ||
| 76 | + speechtext = CFStringCreateWithCString(kCFAllocatorDefault, p_string, p_is_utf8 ? kCFStringEncodingUTF8 : kCFStringEncodingMacRoman); | ||
| 77 | 77 | SpeakCFString(spchannel, speechtext, nil); | |
| 78 | 78 | return true; | |
| 79 | 79 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,7 +32,7 @@ class OSXSpeechNarrator: public INarrator | |||
| 32 | 32 | bool Initialize(void); | |
| 33 | 33 | bool Finalize(void); | |
| 34 | 34 | ||
| 35 | - bool Start(const char* p_string); | ||
| 35 | + bool Start(const char* p_string, bool p_is_utf8); | ||
| 36 | 36 | bool Stop(void); | |
| 37 | 37 | bool Busy(void); | |
| 38 | 38 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -225,14 +225,34 @@ void revSpeechSpeak(char *args[], int nargs, char **retstring, | |||
| 225 | 225 | { | |
| 226 | 226 | NarratorLoad(); | |
| 227 | 227 | ||
| 228 | - s_narrator -> Start(args[0]); | ||
| 228 | + s_narrator -> Start(args[0], false); | ||
| 229 | 229 | } | |
| 230 | 230 | else | |
| 231 | 231 | *error = True; | |
| 232 | 232 | ||
| 233 | 233 | *retstring = result != NULL ? result : strdup(""); | |
| 234 | 234 | } | |
| 235 | 235 | ||
| 236 | + void revSpeechSpeakUTF8(char *args[], int nargs, char **retstring, | ||
| 237 | + Bool *pass, Bool *error) | ||
| 238 | + { | ||
| 239 | + char *result = NULL; | ||
| 240 | + | ||
| 241 | + *pass = False; | ||
| 242 | + *error = False; | ||
| 243 | + | ||
| 244 | + if (nargs == 1) | ||
| 245 | + { | ||
| 246 | + NarratorLoad(); | ||
| 247 | + | ||
| 248 | + s_narrator -> Start(args[0], true); | ||
| 249 | + } | ||
| 250 | + else | ||
| 251 | + *error = True; | ||
| 252 | + | ||
| 253 | + *retstring = result != NULL ? result : strdup(""); | ||
| 254 | + } | ||
| 255 | + | ||
| 236 | 256 | void revSpeechStop(char *args[], int nargs, char **retstring, | |
| 237 | 257 | Bool *pass, Bool *error) | |
| 238 | 258 | { char *result = NULL; | |
@@ -465,7 +485,8 @@ EXTERNAL_BEGIN_DECLARATIONS("revSpeech") | |||
| 465 | 485 | EXTERNAL_DECLARE_COMMAND("revSetSpeechPitch", revSpeechPitch) | |
| 466 | 486 | EXTERNAL_DECLARE_COMMAND("revSetSpeechVolume", revSpeechSetVolume) | |
| 467 | 487 | EXTERNAL_DECLARE_FUNCTION("revGetSpeechVolume", revSpeechGetVolume) | |
| 468 | - EXTERNAL_DECLARE_COMMAND("revSpeak", revSpeechSpeak) | ||
| 488 | + EXTERNAL_DECLARE_COMMAND("revSpeak", revSpeechSpeak) | ||
| 489 | + EXTERNAL_DECLARE_COMMAND_UTF8("revSpeak", revSpeechSpeakUTF8) | ||
| 469 | 490 | EXTERNAL_DECLARE_COMMAND("revStopSpeech", revSpeechStop) | |
| 470 | 491 | EXTERNAL_DECLARE_FUNCTION("revIsSpeaking", revSpeechBusy) | |
| 471 | 492 | EXTERNAL_DECLARE_FUNCTION("revSpeechVoices", revSpeechVoices) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,7 +43,7 @@ class INarrator | |||
| 43 | 43 | virtual bool Initialize(void) = 0; | |
| 44 | 44 | virtual bool Finalize(void) = 0; | |
| 45 | 45 | ||
| 46 | - virtual bool Start(const char* p_string) = 0; | ||
| 46 | + virtual bool Start(const char* p_string, bool p_is_utf8) = 0; | ||
| 47 | 47 | ||
| 48 | 48 | #ifdef FEATURE_REVSPEAKTOFILE | |
| 49 | 49 | virtual bool SpeakToFile(const char* p_string, const char* p_file) = 0; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments