vem_cfg.c 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. #include "audioCfg.h" //struct AudioConfig_t
  2. const AudioConfig_t audio_cfg_default =
  3. {
  4. .amrEncodeBypass = 0,
  5. .amrDecodeBypass = 0,
  6. .amrAllowDtx = 1,
  7. .speechCfgTx =
  8. {
  9. #if defined(TX_AEC)
  10. .CVT_AEC = {
  11. .bypass = 0,
  12. .delay = 0,//yww if>= 0,use this value//ori = 100, modify to 10(10*4=40ms)
  13. .cngMode = 1,
  14. .echoMode = 3,//ori=1,default=3
  15. .nlpFlag = 1,
  16. },
  17. #endif
  18. #if defined(TX_ANS)
  19. .CVT_ANS = {
  20. .bypass = 0,
  21. .mode = 0,
  22. .eqBypass = 0,
  23. .eqBand[0] = 32767,//20240229 //[0-32767]
  24. .eqBand[1] = 32767,
  25. .eqBand[2] = 32767,
  26. .eqBand[3] = 32767,
  27. .eqBand[4] = 32767,
  28. .eqBand[5] = 32767,
  29. .eqBand[6] = 32767,
  30. .eqBand[7] = 32767,
  31. .eqBand[8] = 32767,
  32. .eqBand[9] = 32767,
  33. .eqBand[10] = 32767,
  34. .eqBand[11] = 32767,
  35. .eqBand[12] = 32767,
  36. .eqBand[13] = 32767,
  37. .eqBand[14] = 32767,
  38. .eqBand[15] = 32767,
  39. .eqBand[16] = 32767,
  40. .eqBand[17] = 32767,
  41. .eqBand[18] = 32767,
  42. .eqBand[19] = 32767,
  43. .eqBand[20] = 32767,
  44. .eqBand[21] = 32767,
  45. .eqBand[22] = 32767,
  46. .eqBand[23] = 32767,
  47. .eqBand[24] = 32767,
  48. .eqBand[25] = 32767,
  49. .eqBand[26] = 32767,
  50. .eqBand[27] = 32767,
  51. .eqBand[28] = 32767,
  52. .eqBand[29] = 32767,
  53. .eqBand[30] = 32767,
  54. .eqBand[31] = 32767,
  55. },
  56. #endif
  57. #if defined(TX_DRC)
  58. .CVT_DRC = {
  59. .bypass = 1,
  60. .compThreshold = -960, //-15*2^6=960,Q6
  61. .compRatio = 32, //=(1-1/r)*2^6=(1-1/2)*2^6=32; Q6
  62. .expandThreshold = -2880, // -45*2^6=-2880;Q6
  63. .expandRatio = -51, //=(1-1/r)*2^6=(1-1/0.555f)*2^6=-51; Q6
  64. .attackTime = 14459, //type 1, exp(1/(attack_time * sample_rate))=exp(-1/0.001*8000)*2^14=
  65. .releaseTime = 16046, //type 1,exp(1/(release_time * sample_rate))=exp(-1/0.006*8000)*2^14=
  66. .makeupGain = 1, // 10^(old/20)=10^(6/20)=1.9953,Q? //last gain, fake ,2 be deleted
  67. },
  68. #endif
  69. #if defined(TX_AGC)
  70. .CVT_AGC = {
  71. .bypass = 0,
  72. .targetLevel = 3,
  73. .compressionGain = 6,
  74. .limiterEnable = 1,
  75. },
  76. #endif
  77. #if defined(TX_EQ)
  78. .CVT_EQ = {
  79. .bypass = 0,
  80. .gain = 0,
  81. .num = 1,
  82. .params =
  83. {
  84. {
  85. .type = IIR_BIQUARD_QTY,
  86. .filt = { .design = { 500, 0, 5790 } }
  87. },// can Add more filters
  88. },
  89. },
  90. #endif
  91. },
  92. .speechCfgRx =
  93. {
  94. #if defined(RX_ANS)
  95. .CVT_ANS_RX = {
  96. .bypass = 1,
  97. .mode = 0,
  98. .eqBypass = 0,
  99. .eqBand[0] = 32767,//20240229 //[0-32767]
  100. .eqBand[1] = 32767,
  101. .eqBand[2] = 32767,
  102. .eqBand[3] = 32767,
  103. .eqBand[4] = 32767,
  104. .eqBand[5] = 32767,
  105. .eqBand[6] = 32767,
  106. .eqBand[7] = 32767,
  107. .eqBand[8] = 32767,
  108. .eqBand[9] = 32767,
  109. .eqBand[10] = 32767,
  110. .eqBand[11] = 32767,
  111. .eqBand[12] = 32767,
  112. .eqBand[13] = 32767,
  113. .eqBand[14] = 32767,
  114. .eqBand[15] = 32767,
  115. .eqBand[16] = 32767,
  116. .eqBand[17] = 32767,
  117. .eqBand[18] = 32767,
  118. .eqBand[19] = 32767,
  119. .eqBand[20] = 32767,
  120. .eqBand[21] = 32767,
  121. .eqBand[22] = 32767,
  122. .eqBand[23] = 32767,
  123. .eqBand[24] = 32767,
  124. .eqBand[25] = 32767,
  125. .eqBand[26] = 32767,
  126. .eqBand[27] = 32767,
  127. .eqBand[28] = 32767,
  128. .eqBand[29] = 32767,
  129. .eqBand[30] = 32767,
  130. .eqBand[31] = 32767,
  131. },
  132. #endif
  133. #if defined(RX_DRC)
  134. .CVT_DRC_RX = {
  135. .bypass = 0,
  136. //.type = 1,
  137. .compThreshold = -960, //-15*2^6=960,Q6
  138. .compRatio = 32, //=(1-1/r)*2^6=(1-1/2)*2^6=32; Q6
  139. .expandThreshold = -2880, // -45*2^6=-2880;Q6
  140. .expandRatio = -51, //=(1-1/r)*2^6=(1-1/0.555f)*2^6=-51; Q6
  141. .attackTime = 14459, //type 1, exp(1/(attack_time * sample_rate))=exp(-1/0.001*8000)*2^14=
  142. .releaseTime = 16046, //type 1,exp(1/(release_time * sample_rate))=exp(-1/0.006*8000)*2^14=
  143. .makeupGain = 1, // 10^(old/20)=10^(6/20)=1.9953,Q? //last gain, fake ,2 be deleted
  144. //.delay = 32,
  145. //.tav = 0, //fake,2 be deleted
  146. },
  147. #endif
  148. #if defined(RX_AGC)
  149. .CVT_AGC_RX = {
  150. .bypass = 0,
  151. .targetLevel = 3,
  152. .compressionGain = 9,
  153. .limiterEnable = 1,
  154. },
  155. #endif
  156. #if defined(RX_EQ)
  157. .CVT_EQ_RX = {
  158. .bypass = 0,
  159. .gain = 0,
  160. .num = 1,
  161. .params = {
  162. {
  163. .type = IIR_BIQUARD_QTY,
  164. .filt = { .design = { 500, 0, 5790 } }
  165. },// can Add more filters
  166. },
  167. },
  168. #endif
  169. },
  170. };