-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The basic setup to be able to call the NVDA text-to-speech API on Win…
…64 only.
- Loading branch information
Showing
12 changed files
with
745 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "ppsspp_config.h" | ||
|
||
#include <string> | ||
|
||
#if PPSSPP_PLATFORM(WINDOWS) && PPSSPP_ARCH(AMD64) && !PPSSPP_PLATFORM(UWP) | ||
|
||
#include "ext/nvda/x64/nvdaController.h" | ||
#include "Common/Data/Encoding/Utf8.h" | ||
|
||
void TTS_Say(const char *text) { | ||
std::wstring wstr = ConvertUTF8ToWString(text); | ||
nvdaController_speakText(wstr.c_str()); | ||
} | ||
|
||
void TTS_Braille(const char *text) { | ||
std::wstring wstr = ConvertUTF8ToWString(text); | ||
nvdaController_speakText(wstr.c_str()); | ||
} | ||
|
||
bool TTS_Active() { | ||
return nvdaController_testIfRunning() == 0; | ||
} | ||
|
||
#else | ||
|
||
void TTS_Active() { return false; } | ||
void TTS_Say(const char *text) {} | ||
void TTS_Braille(const char *text) {} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
// Wraps NVDA text-to-speech and possibly other TTS libraries later. | ||
// | ||
// If NVDA is unsupported on the platform or not activated, all the calls will just fail, | ||
// so we don't have to add checks all over the place. | ||
|
||
bool TTS_Active(); | ||
void TTS_Say(const char *text); | ||
void TTS_Braille(const char *text); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.