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.

wave.h 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef WAVE_H
  2. #define WAVE_H
  3. #ifndef PLATFORM_DOS
  4. #include "stdint.h"
  5. #endif
  6. extern int option_device_number;
  7. extern void wave_init();
  8. // TBD: the arg could be "alsa", "oss",...
  9. extern void* wave_open(char* the_api);
  10. extern size_t wave_write(void* theHandler, char* theMono16BitsWaveBuffer, size_t theSize);
  11. extern int wave_close(void* theHandler);
  12. extern void wave_flush(void* theHandler);
  13. extern int wave_is_busy(void* theHandler);
  14. extern void wave_terminate();
  15. extern uint32_t wave_get_read_position(void* theHandler);
  16. extern uint32_t wave_get_write_position(void* theHandler);
  17. // Supply the remaining time in ms before the sample is played
  18. // (or 0 if the event has been already played).
  19. // sample: sample identifier
  20. // time: supplied value in ms
  21. //
  22. // return 0 if ok or -1 otherwise (stream not opened).
  23. extern int wave_get_remaining_time(uint32_t sample, uint32_t* time);
  24. // set the callback which informs if the output is still enabled.
  25. // Helpful if a new sample is waiting for free space whereas sound must be stopped.
  26. typedef int (t_wave_callback)(void);
  27. extern void wave_set_callback_is_output_enabled(t_wave_callback* cb);
  28. // general functions
  29. extern void clock_gettime2(struct timespec *ts);
  30. extern void add_time_in_ms(struct timespec *ts, int time_in_ms);
  31. // for tests
  32. extern void *wave_test_get_write_buffer();
  33. #endif