warning_play.h 845 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef _WATNING_PLAY_H
  2. #define _WATNING_PLAY_H
  3. //#include "piano.h"
  4. #include "wsbc.h"
  5. #define MAX_SERIAL_SIZE (60) //60=24kbps, 40=16kbps
  6. #define SAMPLES_LEN 320
  7. #define CACHE_BUF_SIZE 240
  8. typedef struct {
  9. ring_buf_t res_ring_buf;
  10. s16 obuf[SAMPLES_LEN]; //使用gpdma,需要四字节对齐
  11. u8 ibuf[CACHE_BUF_SIZE];
  12. u8 serial[MAX_SERIAL_SIZE];
  13. u8 frame_size;
  14. u16 samples;
  15. ///用于记录两个拼接的资源文件保存数据
  16. u8 *res_ptr;
  17. u32 res_size;
  18. u32 rd_pos;
  19. } warning_cb_t;
  20. extern warning_cb_t warning_cb;
  21. void warning_dec_check_kick(void);
  22. void warning_dec_proc(void);
  23. int warning_play_init(u8 *ptr, u32 size, bool kick_start);
  24. void warning_play_kick(void);
  25. int warning_play_proc(void);
  26. void warning_play_exit(void);
  27. bool warning_is_playing(void);
  28. #endif //_WATNING_PLAY_H