aem_adapter_audio.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #ifndef AEM_ADAPTER_AUDIO_H
  2. #define AEM_ADAPTER_AUDIO_H
  3. #include <stdint.h>
  4. #include <string.h>
  5. #include <stdbool.h>
  6. typedef enum
  7. {
  8. /** tts event start play */
  9. AEM_AUDIO_START_PLAY = 1,
  10. /** tts event stop play */
  11. AEM_AUDIO_STOP_PLAY = 2,
  12. /** tts event stop play */
  13. AEM_AUDIO_NEXT_PLAY = 3,
  14. } aem_audio_event_e;
  15. typedef enum
  16. {
  17. AEM_AUDIO_CALL,
  18. AEM_AUDIO_RINGTONE,
  19. AEM_AUDIO_LOCAL_MUSIC,
  20. AEM_AUDIO_BT_MUSIC,
  21. } aem_volume_type_e;
  22. typedef enum
  23. {
  24. AEM_RINGTONE_CALLRING,
  25. AEM_RINGTONE_WELCOME,
  26. AEM_RINGTONE_POWEROFF,
  27. AEM_RINGTONE_MAX,
  28. } aem_ringtone_id_e;
  29. typedef struct
  30. {
  31. uint8_t type;
  32. uint8_t name[20 + 1];
  33. } aem_audio_set_t;
  34. typedef void (*aem_audio_event_cb)(uint8_t *name, aem_audio_event_e event);
  35. /**
  36. * @Description : 开始播放音频
  37. * @Param : name(uint8_t *),音频文件名
  38. * @Return :
  39. **/
  40. int aem_tts_play(uint8_t *name);
  41. /**
  42. * @Description : 停止播放音频
  43. * @Param :
  44. * @Return :
  45. **/
  46. int aem_tts_stop(void);
  47. /**
  48. * @Description : 注册tts事件回调
  49. * @Param :
  50. * @Return :
  51. **/
  52. void aem_tts_event_cb_register(aem_audio_event_cb event_cb);
  53. /**
  54. * @Description : 设置系统音量
  55. * @Param : type(aem_volume_type_e):音量类型
  56. * @Param : volume(int):音量等级
  57. * @Return :
  58. **/
  59. int aem_set_system_volume(aem_volume_type_e type, int volume);
  60. /**
  61. * @Description : 获取系统音量
  62. * @Param : type(aem_volume_type_e):音量类型
  63. * @Return :
  64. **/
  65. int aem_get_system_volume(aem_volume_type_e type);
  66. /**
  67. * @Description : 获取系统最小音量
  68. * @Param :
  69. * @Return :
  70. **/
  71. int aem_get_system_min_volume(void);
  72. /**
  73. * @Description : 获取系统最大音量
  74. * @Param :
  75. * @Return :
  76. **/
  77. int aem_get_system_max_volume(void);
  78. /**
  79. * @Description : 获取麦克风静音状态
  80. * @Param :
  81. * @Return :
  82. **/
  83. int aem_get_system_microphone_muted(void);
  84. /**
  85. * @Description : 设置麦克风静音
  86. * @Param : mute value 1: mute 0: unmute
  87. * @Return :
  88. **/
  89. void aem_set_system_microphone_muted(int value);
  90. int aem_get_audio_system_mute(aem_volume_type_e type);
  91. void aem_set_audio_system_mute(aem_volume_type_e type, int mute);
  92. void aem_audio_system_set_stream_volume(aem_volume_type_e type, int volume);
  93. #endif /* AEM_ADAPTER_AUDIO_H */