|
| 1 | +// Copyright(C) 2006-2023 NV Access Limited, Leonard de Ruijter |
| 2 | +// This file is covered by the GNU Lesser General Public License, version 2.1. |
| 3 | +// See the file license.txt for more details. |
| 4 | + |
| 5 | +#define UNICODE |
| 6 | +#include <windows.h> |
| 7 | +#include <stdio.h> |
| 8 | +#include "nvdaController.h" |
| 9 | + |
| 10 | +error_status_t __stdcall onMarkReached(const wchar_t* name) { |
| 11 | + wprintf(L"Reached SSML mark with name %s\n", name); |
| 12 | + return ERROR_SUCCESS; |
| 13 | +} |
| 14 | + |
| 15 | +int main(int argc, char *argv[]) { |
| 16 | + long res = nvdaController_testIfRunning(); |
| 17 | + if (res != 0) { |
| 18 | + MessageBox(0, L"Error communicating with NVDA", L"Error", 0); |
| 19 | + return 1; |
| 20 | + } |
| 21 | + for (int i = 0; i < 4; i++) { |
| 22 | + nvdaController_speakText(L"This is a test speech message"); |
| 23 | + nvdaController_brailleMessage(L"This is a test braille message"); |
| 24 | + Sleep(1000); |
| 25 | + } |
| 26 | + wchar_t* ssml = ( |
| 27 | + L"<speak>" |
| 28 | + L"This is one sentence. " |
| 29 | + L"<mark name=\"test\" />" |
| 30 | + L"<prosody pitch=\"200%\">This sentence is pronounced with higher pitch.</prosody>" |
| 31 | + L"<mark name=\"test2\" />" |
| 32 | + L"This is a third sentence. " |
| 33 | + L"<mark name=\"test3\" />" |
| 34 | + L"This is a fourth sentence. We will stay silent for a second after this one." |
| 35 | + L"<break time=\"1000ms\" />" |
| 36 | + L"<mark name=\"test4\" />" |
| 37 | + L"This is a fifth sentence. " |
| 38 | + L"<mark name=\"test5\" />" |
| 39 | + L"</speak>" |
| 40 | + ); |
| 41 | + nvdaController_setOnSsmlMarkReachedCallback(&onMarkReached); |
| 42 | + nvdaController_speakSsml(ssml, SYMBOL_LEVEL_UNCHANGED, SPEECH_PRIORITY_NORMAL, FALSE); |
| 43 | + nvdaController_setOnSsmlMarkReachedCallback(NULL); |
| 44 | + nvdaController_brailleMessage(L"Test completed!"); |
| 45 | + return 0; |
| 46 | +} |
0 commit comments