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.

fifo.h 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef FIFO_H
  2. #define FIFO_H
  3. // Helps to add espeak commands in a first-in first-out queue
  4. // and run them asynchronously.
  5. #include "espeak_command.h"
  6. #include "speak_lib.h"
  7. // Initialize the fifo component.
  8. // First function to be called.
  9. void fifo_init();
  10. // Add an espeak command.
  11. //
  12. // Note: this function fails if too many commands are already buffered.
  13. // In such a case, the calling function could wait and then add again its command.
  14. //
  15. // Return: EE_OK: operation achieved
  16. // EE_BUFFER_FULL: the command can not be buffered;
  17. // you may try after a while to call the function again.
  18. // EE_INTERNAL_ERROR.
  19. espeak_ERROR fifo_add_command (t_espeak_command* c);
  20. // Add two espeak commands in a single transaction.
  21. //
  22. // Note: this function fails if too many commands are already buffered.
  23. // In such a case, the calling function could wait and then add again these commands.
  24. //
  25. // Return: EE_OK: operation achieved
  26. // EE_BUFFER_FULL: at least one command can not be buffered;
  27. // you may try after a while to call the function again.
  28. // EE_INTERNAL_ERROR.
  29. espeak_ERROR fifo_add_commands (t_espeak_command* c1, t_espeak_command* c2);
  30. // The current running command must be stopped and the awaiting commands are cleared.
  31. // Return: EE_OK: operation achieved
  32. // EE_INTERNAL_ERROR.
  33. espeak_ERROR fifo_stop ();
  34. // Is there a running command?
  35. // Returns 1 if yes; 0 otherwise.
  36. int fifo_is_busy ();
  37. // Terminate the fifo component.
  38. // Last function to be called.
  39. void fifo_terminate();
  40. // Indicates if the running command is still enabled.
  41. //
  42. // Note: this function is mainly called by the SynthCallback (speak_lib.cpp)
  43. // It indicates if the actual wave sample can still be played. It is helpful for
  44. // stopping speech as soon as a cancel command is applied.
  45. //
  46. // Returns 1 if yes, or 0 otherwise.
  47. int fifo_is_command_enabled();
  48. #endif