问题:wav_get_rate(wav)返回类型是unit16_t,然后与1000相乘后返回int类型

error: non-constant-expression cannot be narrowed from type 'int' to 'SLuint32'

 

但是需要返回unit32_t类型,然后报了下面的错误

error: non-constant-expression cannot be narrowed from type 'int' to 'SLuint32'

 

原因:返回的类型与所需要的类型不一致

解决办法:

将int类型转为unit类型

error: non-constant-expression cannot be narrowed from type 'int' to 'SLuint32'

 

相关文章:

  • 2021-11-28
  • 2022-12-23
  • 2021-11-27
  • 2021-09-23
  • 2021-05-26
  • 2021-06-23
猜你喜欢
  • 2021-05-31
  • 2022-01-15
  • 2022-12-23
  • 2021-06-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案