当前位置: 首页 > wzjs >正文

做网站之前要先购买服务器吗免费推广的方式有哪些

做网站之前要先购买服务器吗,免费推广的方式有哪些,wordpress 维护页面,手机图片网站模板随着5.0的版本的迭代升级,笔者感受到了开源鸿蒙前所未有大的版本更替速度。5.0出现了越来越多的C API可以调用,极大的方便了native c应用的开发。笔者先将speexdsp噪声消除的案例分享,老规矩,还是开源!!&am…

随着5.0的版本的迭代升级,笔者感受到了开源鸿蒙前所未有大的版本更替速度。5.0出现了越来越多的C API可以调用,极大的方便了native c++应用的开发。笔者先将speexdsp噪声消除的案例分享,老规矩,还是开源!!!

开源地址:https://gitee.com/from-north-to-north/OpenHarmony_p7885/tree/3b8ffd1c5223688f0b1e1f011187a6a392b4fcdf/hap/easy_demo/speexdsp
编译好的hap:https://gitee.com/from-north-to-north/OpenHarmony_p7885/blob/3b8ffd1c5223688f0b1e1f011187a6a392b4fcdf/hap/easy_demo/speexdsp/hap/speexdsp.hap

声明:本案例基于 https://gitee.com/harmonyos_samples/audio-native 开源案例的基础上修改,增加speexdsp噪声消除功能

一、speexdsp交叉编译

https://gitcode.com/openharmony-sig/tpc_c_cplusplus/tree/master/community/speexdsp

image.png

教程请参考:
https://gitcode.com/openharmony-sig/tpc_c_cplusplus/blob/master/community/openssl_1_1_1w/docs/hap_integrate.md

二、核心实现代码
核心代码:https://gitee.com/from-north-to-north/OpenHarmony_p7885/blob/master/hap/easy_demo/speexdsp/entry/src/main/cpp/AudioRecording.cpp

#include <iostream>
#include <speex/speex_preprocess.h>#define FRAME_SIZE 160
#define SAMPLE_RATE 8000bool denoisePCMFile(const char* filePath) {// 以读写二进制模式打开文件FILE* file = fopen(filePath, "rb+");if (!file) {LOGI("denoisePCMFile open files failed");return false;}// 初始化speex预处理状态SpeexPreprocessState* st = speex_preprocess_state_init(FRAME_SIZE, SAMPLE_RATE);if (!st) {LOGI("denoisePCMFile 无法初始化speex预处理状态");fclose(file);return false;}// 设置降噪参数int denoise = 1;speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DENOISE, &denoise);short frame[FRAME_SIZE];size_t readSize;while ((readSize = fread(frame, sizeof(short), FRAME_SIZE, file)) == FRAME_SIZE) {// 对帧进行降噪处理speex_preprocess_run(st, frame);// 将文件指针移动到当前帧的起始位置fseek(file, -static_cast<long>(readSize * sizeof(short)), SEEK_CUR);// 将处理后的帧写回文件fwrite(frame, sizeof(short), FRAME_SIZE, file);}// 释放speex预处理状态speex_preprocess_state_destroy(st);// 关闭文件fclose(file);LOGI("denoisePCMFile 降噪处理完成,已覆盖原文件");return true;
}napi_value DenoisePCMFile(napi_env env, napi_callback_info info) {if ((nullptr == env) || (nullptr == info)) {LOGE("GetUptime: env or info is null");return nullptr;}napi_value thisArg;if (napi_ok != napi_get_cb_info(env, info, nullptr, nullptr, &thisArg, nullptr)) {LOGE("GetUptime: napi_get_cb_info fail");return nullptr;}std::string time ;const char* filePath = "/data/storage/el2/base/haps/entry/files/oh_test_audio.pcm";if (denoisePCMFile(filePath)) {LOGI("denoisePCMFile success");time = "success";}else{LOGI("denoisePCMFile failed");time = "failed";}LOGI("getUptime success! %{public}s", time.c_str());napi_value res;napi_create_string_utf8(env, time.c_str(), strlen(time.c_str()), &res);return res;
}

snapshot_20250327_144159.jpg

http://www.dtcms.com/wzjs/43560.html

相关文章:

  • 宁波外贸网站推广东莞搜索优化
  • 简单模板网站制作时间品牌推广方案策划书
  • 庆祝网站上线banner图片网络广告宣传怎么做
  • 做网站专题页的字大小是多少百度关键词seo排名
  • 淘宝网站的建设目的是什么意思网络媒体
  • wordpress无法设置主页seo网络培训
  • 嘉兴网站建设运营推广自己产品的文案
  • 长沙网站排名公司网络公司网站建设
  • 为女朋友做的表白网站南宁关键词优化服务
  • 建设通网站免费注册优化培训内容
  • 广州网站建设哪个公司做得好些淘宝引流推广平台
  • 网站建设it网推是干什么的
  • 郑州炫彩网站建设个人网站怎么建立
  • 网站建设哪种语言好百度宁波营销中心
  • 上饶网站建设多少钱商丘网站建设公司
  • 怎样做网站api接口新站seo竞价
  • 可以使用ftp的网站百度官方网站首页
  • 景宁建设局网站官网成都网站设计
  • 泉州网红打卡地福州短视频seo方法
  • 网站建设如何避免陷入模仿误区广告公司名字
  • 高培淇自己做的网站友情链接交换形式
  • 如何做搜索网站中小企业网站
  • 网站开发项目需求书宁波网站推广平台效果好
  • 外贸推广网站哪家百度网址导航
  • 广州做网站哪里好跨境电商有哪些平台
  • 英文网站建设详细方案电销外包团队在哪找
  • 小说网站编辑怎么做企业网站优化服务
  • 个人网站怎么挣钱南宁网
  • 在国外做电商网站免费网站流量统计
  • 网站后台下载成人短期培训能学什么