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.

event.h 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef EVENT_H
  2. #define EVENT_H
  3. /*
  4. Manage events (sentence, word, mark, end,...), is responsible of calling the external
  5. callback as soon as the relevant audio sample is played.
  6. The audio stream is composed of samples from synthetised messages or audio icons.
  7. Each event is associated to a sample.
  8. Scenario:
  9. - event_declare is called for each expected event.
  10. - A timeout is started for the first pending event.
  11. - When the timeout happens, the synth_callback is called.
  12. Note: the timeout is checked against the real progress of the audio stream, which depends on pauses or underruns. If the real progress is lower than the expected one, a new timeout starts.
  13. */
  14. #include "speak_lib.h"
  15. // Initialize the event component.
  16. // First function to be called.
  17. // the callback will be called when the event actually occurs.
  18. // The callback is detailled in speak_lib.h .
  19. void event_init(t_espeak_callback* cb);
  20. // Clear any pending event.
  21. //
  22. // Return: EE_OK: operation achieved
  23. // EE_INTERNAL_ERROR.
  24. espeak_ERROR event_clear_all ();
  25. // Declare a future event
  26. //
  27. // Return: EE_OK: operation achieved
  28. // EE_BUFFER_FULL: the event can not be buffered;
  29. // you may try after a while to call the function again.
  30. // EE_INTERNAL_ERROR.
  31. espeak_ERROR event_declare (espeak_EVENT* event);
  32. // Terminate the event component.
  33. // Last function to be called.
  34. void event_terminate();
  35. #endif