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

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