佛山三水网站建设,今天大连最新通告,山东东营市东营区邮编,个人网站赏析文章目录 一、介绍二、安装soundtouch2.1 源码安装方式#xff08;推荐#xff09;2.1.1下载源码2.1.2解压2.1.3 编译2.1.4 迁移#xff08;可选#xff09; 2.2 apt-get 安装 三、使用3.1 终端使用3.2 Freeswitch使用3.2.1编译Freeswitch的mod_soundtouch3.2.2启用 mod_so… 文章目录 一、介绍二、安装soundtouch2.1 源码安装方式推荐2.1.1下载源码2.1.2解压2.1.3 编译2.1.4 迁移可选 2.2 apt-get 安装 三、使用3.1 终端使用3.2 Freeswitch使用3.2.1编译Freeswitch的mod_soundtouch3.2.2启用 mod_soundtouch 模块3.3.3 使用使用api命令使用lua使用拨号计划 四 问题4.1 没有变声只有刺啦刺啦的声音 一、介绍
相关资料 Freeswitch关于soundtouch介绍
soundtouch下载
mod_soundtouch只有刺啦刺啦声音问题
FreeSWITCH使用soundtouch进行变声
二、安装soundtouch
我这里使用的环境docker是debian。其他环境也可以。
2.1 源码安装方式推荐
2.1.1下载源码
https://codeberg.org/soundtouch/soundtouch/tags放到合适的位置进行解压
2.1.2解压
tar -zxvf soundtouch-2.3.3.tar.gz 2.1.3 编译
cd soundtouch
./bootstrap 默认的 debian 版本是用浮点样本编译的。 需要用整数样本重新编译它才能与 freeswitch 兼容。 --enable-integer-samples
./configure --enable-integer-samples
make
make install2.1.4 迁移可选
我这里有两个环境一个是编译环境一个是运行环境所以我知道要吧这四个编译好的文件放到运行环境相同目录下面就可以。然后执行ldconfig重新加载一下环境。
2.2 apt-get 安装 apt-get install libsoundtouch-dev libsoundtouch1 三、使用
3.1 终端使用
1变速不变调
soundstretch original.wav out30.wav -tempo30 # 加速时常变短 soundstretch original.wav out30.wav -tempo-30 # 减速时常变长 2 变调不变速
soundstretch original.wav pitch30.wav -pitch5 # 音调调高可以将男声变成女声 soundstretch pitch30.wav normal.wav -pitch-5 # 音调调低可以将女声变成男声 3变速且变调
soundstretch original.wav rate25.wav -rate25
3.2 Freeswitch使用
3.2.1编译Freeswitch的mod_soundtouch
首先进入源mod
cd freeswitch1_10_7/src/mod/applications/mod_soundtouchmakemake install可以在Freeswitch的生成环境下看到已经编译生成mod了
3.2.2启用 mod_soundtouch 模块
在编译生成的Freeswitch目录下 /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml 添加内容 load modulemod_soundtouch/ 然后重启
临时添加此mod,在fs_cli 执行load mod_soundtouch
3.3.3 使用
使用api命令
1soundtouch命令格式
soundtouch uuid [start|stop] [send_leg] [hook_dtmf] [-]Xs [-]Xo Xp Xr Xtsoundtouch 参数说明
uuid 必选参数需要进行变声操作leg的uuidstart|stop 必选参数使用start时后面要跟参数不能连续两次start可以在同一个命令里面把所有参数都设置好。 使用stop时之前必须有start操作。send_leg 可选参数 不指定该参数时用于该uuid发出去的音频变声说的声音变声 指定该参数时用于该uuid收到的音频变声听的声音变声。hook_dtmf 可选参数 指定该参数时在电话侧可用dtmf按键进行变声操作。如果指定它将挂钩 DTMF 音调并根据底部的 DTMF 代码修改音高/速率/节奏s 以半音为单位调整音高值应在 -14 到 14 之间默认为 0o 以八度为单位调整音高值应介于 -1 和 1 之间默认为 0p 直接设置音调值应 0默认1较低低音调r 设置速率值应大于 0默认为 1越低 越慢t 设置节奏值应大于 0默认为 1越低 越慢
测试命令
originate user/1001 endless_playback(/usr/local/freeswitch/sounds/original.wav)soundtouch uuid start send_leg 4s
soundtouch uuid stop
soundtouch uuid start send_leg -4s使用lua
例如要在 Lua 中启动 soundtouch请使用这会将音调降低 0.2 个八度
session:execute(soundtouch, -0.2o) 要将音调重置为正常此方法将不起作用
session:execute(soundtouch, 0.2o) 即使这样也行不通
session:execute(soundtouch, 0o) 您需要通过以下命令明确“停止”soundtouch
session:execute(soundtouch,stop)随后您可以通过发出新的命令再次进行俯仰/速率变换例如
session:execute(soundtouch,0.8r) 使用拨号计划 action applicationsoundtouch datahook_dtmf -0.3o 0.8r/四 问题
4.1 没有变声只有刺啦刺啦的声音
我已经在这里回答过了 https://github.com/signalwire/freeswitch/issues/93 欢迎讨论18956043585