eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

voices.c 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (C) 2017 Reece H. Dunn
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write see:
  16. * <http://www.gnu.org/licenses/>.
  17. */
  18. #include "config.h"
  19. #include <assert.h>
  20. #include <stdint.h>
  21. #include <stdlib.h>
  22. #include <stdio.h>
  23. #include <espeak-ng/espeak_ng.h>
  24. #include <espeak-ng/speak_lib.h>
  25. void
  26. test_selection_by_name()
  27. {
  28. printf("testing selection of voice by name\n");
  29. assert(espeak_SetVoiceByName("de") == EE_OK);
  30. assert(espeak_SetVoiceByName("und") == EE_NOT_FOUND);
  31. assert(espeak_ng_SetVoiceByName("de") == ENS_OK);
  32. assert(espeak_ng_SetVoiceByName("und") == ENS_VOICE_NOT_FOUND);
  33. }
  34. int
  35. main(int argc, char **argv)
  36. {
  37. assert(espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, 0, NULL, espeakINITIALIZE_DONT_EXIT) == 22050);
  38. test_selection_by_name();
  39. assert(espeak_Terminate() == EE_OK);
  40. return EXIT_SUCCESS;
  41. }