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 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (C) 2007, Gilles Casse <[email protected]>
  3. * Copyright (C) 2015-2016 Reece H. Dunn
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, see: <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef FIFO_H
  19. #define FIFO_H
  20. // Helps to add espeak commands in a first-in first-out queue
  21. // and run them asynchronously.
  22. #ifdef __cplusplus
  23. extern "C"
  24. {
  25. #endif
  26. // Initialize the fifo component.
  27. // First function to be called.
  28. void fifo_init(void);
  29. // Add an espeak command.
  30. //
  31. // Note: this function fails if too many commands are already buffered.
  32. // In such a case, the calling function could wait and then add again its command.
  33. espeak_ng_STATUS fifo_add_command(t_espeak_command *c);
  34. // Add two espeak commands in a single transaction.
  35. //
  36. // Note: this function fails if too many commands are already buffered.
  37. // In such a case, the calling function could wait and then add again these commands.
  38. espeak_ng_STATUS fifo_add_commands(t_espeak_command *c1, t_espeak_command *c2);
  39. // The current running command must be stopped and the awaiting commands are cleared.
  40. espeak_ng_STATUS fifo_stop(void);
  41. // Is there a running command?
  42. // Returns 1 if yes; 0 otherwise.
  43. int fifo_is_busy(void);
  44. // Terminate the fifo component.
  45. // Last function to be called.
  46. void fifo_terminate(void);
  47. // Indicates if the running command is still enabled.
  48. //
  49. // Note: this function is mainly called by the SynthCallback (speak_lib.cpp)
  50. // It indicates if the actual wave sample can still be played. It is helpful for
  51. // stopping speech as soon as a cancel command is applied.
  52. //
  53. // Returns 1 if yes, or 0 otherwise.
  54. int fifo_is_command_enabled(void);
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58. #endif