audio_demo.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /** @file
  2. audio_demo.h
  3. @brief
  4. This file is used to define audio demo for different Quectel Project.
  5. */
  6. /*================================================================
  7. Copyright (c) 2020 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
  8. Quectel Wireless Solution Proprietary and Confidential.
  9. =================================================================*/
  10. #ifndef AUDIO_DEMO_H
  11. #define AUDIO_DEMO_H
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include "ql_audio.h"
  16. #include "ql_api_common.h"
  17. #include "ql_app_feature_config.h"
  18. /*========================================================================
  19. * Variable Definition
  20. *========================================================================*/
  21. #define RECORD_BUFFER_MAX (uint)100*1024
  22. #define TEST_PLAY_VOLUME AUDIOHAL_SPK_VOL_11
  23. #define TEST_MP3_FILE_NAME "UFS:test_mp3.mp3"
  24. #define TEST_WAV_FILE_NAME "UFS:test_wav.wav"
  25. #define TEST_AMR_FILE_NAME "UFS:test_amr.amr"
  26. #define TEST_RECORD_WAV_NAME "UFS:test_record_wav.wav"
  27. #define TEST_RECORD_PCM_NAME "UFS:test_record_pcm.pcm"
  28. /*
  29. demo使用的iic通道,引脚配置,用户根据实际使用的引脚和通道来配置
  30. */
  31. #define QL_CUR_IIC_CHANNEL i2c_2
  32. #define QL_CUR_IIC_CLK_PIN QUEC_PIN_DNAME_I2C_M2_SCL
  33. #define QL_CUR_IIC_SDA_PIN QUEC_PIN_DNAME_I2C_M2_SDA
  34. #define QL_USE_CODEC_ES8311 0
  35. #define QL_USE_DAC_TM8211 0
  36. #define QL_USE_DAC_ES7148 0
  37. /*========================================================================
  38. * function Definition
  39. *========================================================================*/
  40. void ql_audio_app_init(void);
  41. void test_pcm(void);
  42. void test_mp3(void);
  43. void test_wav(void);
  44. void test_amr(void);
  45. void test_record_file(void);
  46. void test_record_stream(void);
  47. void test_amr_stream(void);
  48. void test_poc_half_duplex(void);
  49. void test_poc_full_duplex(void);
  50. //void test_ring_tone(void);
  51. void config_internal_codec_gain(void);
  52. int check_audio_format(char *fname);
  53. //void test_tone_dtmf(void);
  54. void ql_headset_det_app_init(void);
  55. #ifdef QL_APP_FEATURE_EXT_CODEC
  56. void ql_ext_codec_cb_init(void);
  57. #endif
  58. #ifdef __cplusplus
  59. } /*"C" */
  60. #endif
  61. #endif /* AUDIO_DEMO_H */