1 Star 0 Fork 0

凌逆战/resample

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
data_utils.c 471 Bytes
一键复制 编辑 原始数据 按行查看 历史
never.ling 提交于 2023-10-23 23:58 +08:00 . 添加了双路resample
/*
* Author: 凌逆战 | Never
* Data: 2023/10/10
* Description:
*/
void convert_i16_to_f32(short* p_in, int len, float* p_out) {
for (int i = 0; i < len; i++) {
*p_out++ = *p_in++ / 32768.0f;
}
}
void convert_f32_to_i16(float* p_in, int len, short* p_out) {
for (int i = 0; i < len; i++) {
float tmp = *p_in++ * 32768.0f;
*p_out++ = (short)(tmp < -32768.f ? -32768.f : (tmp > 32767.f ? 32767.f : tmp));
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/LXP-Never/resample.git
git@gitee.com:LXP-Never/resample.git
LXP-Never
resample
resample
master

搜索帮助