as_dae_setting.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (c) 2017 Actions Semi Co., Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. * Author: jpl<jianpingliao@actions-semi.com>
  16. *
  17. * Change log:
  18. * 2019/12/16: Created by jpl.
  19. */
  20. #ifndef __AS_DAE_SETTING_H__
  21. #define __AS_DAE_SETTING_H__
  22. #define AS_DAE_EQ_NUM_BANDS (20)
  23. #define AS_DAE_PARA_BIN_SIZE (sizeof(((as_dae_para_info_t*)0)->aset_bin))
  24. typedef struct
  25. {
  26. // [INPUT]: sample rate in Hz
  27. int sample_rate;
  28. // [INPUT]: address of library internal frame buf
  29. // dae_buf_addr[0-1]: global buffer, size equal to block_size * 4, aligned to 4 bytes.
  30. // dae_buf_addr[2]: share buffer, size equal to block_size * 2, only accessed in
  31. // DAE_CMD_FRAME_PROCESS for 1 channel pcm data
  32. int dae_buf_addr[3];
  33. // [INPUT]: dae process main switch
  34. short dae_enable;
  35. // [INPUT]: dae process channels
  36. short channels;
  37. // [INPUT]: dae process block size in sample (pairs)
  38. short block_size;
  39. // [INPUT]: dae process bypass switch.
  40. // If set 1, all effect will not work except pre_soft_volume, soft_volume, fade in/out, and output_channel_config
  41. short bypass;
  42. // [INPUT]: pre soft volume in 0.1 dB. set 0 to bypass it.
  43. short pre_soft_volume;
  44. // [INPUT]: soft volume in 0.1 dB. set 0 to bypass it.
  45. short soft_volume;
  46. // [INPUT]: fade in time in ms.
  47. short fade_in_time_ms;
  48. // [INPUT]: fade out time in ms.
  49. short fade_out_time_ms;
  50. // [INPUT]: fade flag. 1: fade in; 2: fade out
  51. short fade_flag;
  52. // [INPUT]: dae process output config
  53. // 0: do nothing: 1: swap left-right channel; 2: mix left-right channel (L=R=L/2 + R/2)
  54. // 3: only left channel (R=L); 4: only right channel (L=R)
  55. short output_channel_config;
  56. // [INPUT]: dae process sample bits. only 16 supported so far
  57. short bit_width;
  58. short reserve_0;
  59. } music_common_para_t;
  60. typedef struct
  61. {
  62. short freq_display_enable;
  63. short freq_point_num;
  64. short freq_point[10];
  65. } freq_display_para_t;
  66. /*for DAE AL*/
  67. typedef struct
  68. {
  69. music_common_para_t music_common_para;
  70. freq_display_para_t freq_display_para;
  71. char aset_bin[512];
  72. } as_dae_para_info_t;
  73. #endif /* __AS_DAE_SETTING_H__ */