yzx 19 godzin temu
rodzic
commit
e2c7859066

+ 10 - 0
ruoyi-admin/src/main/resources/static/i18n/messages.properties

@@ -218,6 +218,16 @@ switchconf.tts.ali.header=阿里云tts参数配置
 switchconf.tts.doubao.header=豆包tts参数配置
 switchconf.tts.chinatelecom.header=电信tts参数配置
 switchconf.tts.tx1.header=腾讯云TTS参数配置
+switchconf.tts.tx1.notice=腾讯云 TTS1 已切换为 WebSocket 协议。电话场景建议使用 `ulaw/alaw + 8000`;离线文件合成请优先使用当前页面可协商出的兼容格式。
+switchconf.tts.tx1.help.format=FS 实时播报只推荐 `ulaw/alaw/pcm`,最终以握手包协商结果为准。
+switchconf.tts.tx1.help.effectRange=可选,范围 `-100 ~ 100`;留空表示不透传给腾讯。
+switchconf.tts.tx1.help.soundEffect=声音效果器仅部分腾讯音色支持;不支持时上游会静默忽略。
+switchconf.tts.tx1.validate.effectRange=必须是 -100 到 100 之间的整数
+switchconf.tts.tx1.effect.none=(不传)
+switchconf.tts.tx1.effect.spaciousEcho=空旷回音
+switchconf.tts.tx1.effect.auditoriumEcho=礼堂广播
+switchconf.tts.tx1.effect.lofiTelephone=电话失真
+switchconf.tts.tx1.effect.robotic=电音
 switchconf.tts.xf.header=科大讯飞TTS参数配置
 switchconf.asr.engine.header=asr引擎选择
 switchconf.asr.engine.option1=无

+ 10 - 0
ruoyi-admin/src/main/resources/static/i18n/messages_en.properties

@@ -218,6 +218,16 @@ switchconf.tts.ali.header=Alibaba Cloud TTS Parameter Configuration
 switchconf.tts.doubao.header=Doubao TTS Parameter Configuration
 switchconf.tts.chinatelecom.header=ChinaTele TTS Parameter Configuration
 switchconf.tts.tx1.header=Tencent Cloud TTS Parameter Configuration
+switchconf.tts.tx1.notice=Tencent Cloud TTS1 now uses the WebSocket protocol. For telephony, `ulaw/alaw + 8000` is recommended; for offline synthesis, prefer the compatible format negotiated on this page.
+switchconf.tts.tx1.help.format=For FreeSWITCH real-time playback, only `ulaw/alaw/pcm` is recommended. The final format depends on the handshake negotiation result.
+switchconf.tts.tx1.help.effectRange=Optional. Valid range is `-100 ~ 100`; leave empty to avoid sending this parameter to Tencent.
+switchconf.tts.tx1.help.soundEffect=Sound effects are supported only by some Tencent voices. Unsupported voices will silently ignore this parameter.
+switchconf.tts.tx1.validate.effectRange=must be an integer between -100 and 100
+switchconf.tts.tx1.effect.none=(Not sent)
+switchconf.tts.tx1.effect.spaciousEcho=Spacious Echo
+switchconf.tts.tx1.effect.auditoriumEcho=Auditorium Echo
+switchconf.tts.tx1.effect.lofiTelephone=Lo-fi Telephone
+switchconf.tts.tx1.effect.robotic=Robotic
 switchconf.tts.xf.header=IFlytek TTS Parameter Configuration
 switchconf.asr.engine.header=ASR Engine Selection
 switchconf.asr.engine.option1=None

+ 10 - 0
ruoyi-admin/src/main/resources/static/i18n/messages_en_US.properties

@@ -218,6 +218,16 @@ switchconf.tts.ali.header=Alibaba Cloud TTS Parameter Configuration
 switchconf.tts.doubao.header=Doubao TTS Parameter Configuration
 switchconf.tts.chinatelecom.header=ChinaTele TTS Parameter Configuration
 switchconf.tts.tx1.header=Tencent Cloud TTS Parameter Configuration
+switchconf.tts.tx1.notice=Tencent Cloud TTS1 now uses the WebSocket protocol. For telephony, `ulaw/alaw + 8000` is recommended; for offline synthesis, prefer the compatible format negotiated on this page.
+switchconf.tts.tx1.help.format=For FreeSWITCH real-time playback, only `ulaw/alaw/pcm` is recommended. The final format depends on the handshake negotiation result.
+switchconf.tts.tx1.help.effectRange=Optional. Valid range is `-100 ~ 100`; leave empty to avoid sending this parameter to Tencent.
+switchconf.tts.tx1.help.soundEffect=Sound effects are supported only by some Tencent voices. Unsupported voices will silently ignore this parameter.
+switchconf.tts.tx1.validate.effectRange=must be an integer between -100 and 100
+switchconf.tts.tx1.effect.none=(Not sent)
+switchconf.tts.tx1.effect.spaciousEcho=Spacious Echo
+switchconf.tts.tx1.effect.auditoriumEcho=Auditorium Echo
+switchconf.tts.tx1.effect.lofiTelephone=Lo-fi Telephone
+switchconf.tts.tx1.effect.robotic=Robotic
 switchconf.tts.xf.header=IFlytek TTS Parameter Configuration
 switchconf.asr.engine.header=ASR Engine Selection
 switchconf.asr.engine.option1=None

+ 10 - 0
ruoyi-admin/src/main/resources/static/i18n/messages_ja_JP.properties

@@ -218,6 +218,16 @@ switchconf.tts.ali.header=Alibaba Cloud TTS Parameter Configuration
 switchconf.tts.doubao.header=Doubao TTS Parameter Configuration
 switchconf.tts.chinatelecom.header=ChinaTele TTS Parameter Configuration
 switchconf.tts.tx1.header=Tencent Cloud TTS Parameter Configuration
+switchconf.tts.tx1.notice=Tencent Cloud TTS1 now uses the WebSocket protocol. For telephony, `ulaw/alaw + 8000` is recommended; for offline synthesis, prefer the compatible format negotiated on this page.
+switchconf.tts.tx1.help.format=For FreeSWITCH real-time playback, only `ulaw/alaw/pcm` is recommended. The final format depends on the handshake negotiation result.
+switchconf.tts.tx1.help.effectRange=Optional. Valid range is `-100 ~ 100`; leave empty to avoid sending this parameter to Tencent.
+switchconf.tts.tx1.help.soundEffect=Sound effects are supported only by some Tencent voices. Unsupported voices will silently ignore this parameter.
+switchconf.tts.tx1.validate.effectRange=must be an integer between -100 and 100
+switchconf.tts.tx1.effect.none=(Not sent)
+switchconf.tts.tx1.effect.spaciousEcho=Spacious Echo
+switchconf.tts.tx1.effect.auditoriumEcho=Auditorium Echo
+switchconf.tts.tx1.effect.lofiTelephone=Lo-fi Telephone
+switchconf.tts.tx1.effect.robotic=Robotic
 switchconf.tts.xf.header=IFlytek TTS Parameter Configuration
 switchconf.asr.engine.header=ASR Engine Selection
 switchconf.asr.engine.option1=None

+ 10 - 0
ruoyi-admin/src/main/resources/static/i18n/messages_zh.properties

@@ -218,6 +218,16 @@ switchconf.tts.ali.header=阿里云tts参数配置
 switchconf.tts.doubao.header=豆包tts参数配置
 switchconf.tts.chinatelecom.header=电信tts参数配置
 switchconf.tts.tx1.header=腾讯云TTS参数配置
+switchconf.tts.tx1.notice=腾讯云 TTS1 已切换为 WebSocket 协议。电话场景建议使用 `ulaw/alaw + 8000`;离线文件合成请优先使用当前页面可协商出的兼容格式。
+switchconf.tts.tx1.help.format=FS 实时播报只推荐 `ulaw/alaw/pcm`,最终以握手包协商结果为准。
+switchconf.tts.tx1.help.effectRange=可选,范围 `-100 ~ 100`;留空表示不透传给腾讯。
+switchconf.tts.tx1.help.soundEffect=声音效果器仅部分腾讯音色支持;不支持时上游会静默忽略。
+switchconf.tts.tx1.validate.effectRange=必须是 -100 到 100 之间的整数
+switchconf.tts.tx1.effect.none=(不传)
+switchconf.tts.tx1.effect.spaciousEcho=空旷回音
+switchconf.tts.tx1.effect.auditoriumEcho=礼堂广播
+switchconf.tts.tx1.effect.lofiTelephone=电话失真
+switchconf.tts.tx1.effect.robotic=电音
 switchconf.tts.xf.header=科大讯飞TTS参数配置
 switchconf.asr.engine.header=asr引擎选择
 switchconf.asr.engine.option1=无

+ 10 - 0
ruoyi-admin/src/main/resources/static/i18n/messages_zh_CN.properties

@@ -218,6 +218,16 @@ switchconf.tts.ali.header=阿里云tts参数配置
 switchconf.tts.doubao.header=豆包tts参数配置
 switchconf.tts.chinatelecom.header=电信tts参数配置
 switchconf.tts.tx1.header=腾讯云TTS参数配置
+switchconf.tts.tx1.notice=腾讯云 TTS1 已切换为 WebSocket 协议。电话场景建议使用 `ulaw/alaw + 8000`;离线文件合成请优先使用当前页面可协商出的兼容格式。
+switchconf.tts.tx1.help.format=FS 实时播报只推荐 `ulaw/alaw/pcm`,最终以握手包协商结果为准。
+switchconf.tts.tx1.help.effectRange=可选,范围 `-100 ~ 100`;留空表示不透传给腾讯。
+switchconf.tts.tx1.help.soundEffect=声音效果器仅部分腾讯音色支持;不支持时上游会静默忽略。
+switchconf.tts.tx1.validate.effectRange=必须是 -100 到 100 之间的整数
+switchconf.tts.tx1.effect.none=(不传)
+switchconf.tts.tx1.effect.spaciousEcho=空旷回音
+switchconf.tts.tx1.effect.auditoriumEcho=礼堂广播
+switchconf.tts.tx1.effect.lofiTelephone=电话失真
+switchconf.tts.tx1.effect.robotic=电音
 switchconf.tts.xf.header=科大讯飞TTS参数配置
 switchconf.asr.engine.header=asr引擎选择
 switchconf.asr.engine.option1=无

+ 32 - 4
ruoyi-admin/src/main/resources/templates/cc/txtts1conf/txtts1conf.html

@@ -11,9 +11,7 @@
 <body>
 <div class="main-content">
     <div class="h4 form-header" th:text="#{switchconf.tts.tx1.header}"></div>
-    <div class="alert alert-info">
-        腾讯云 TTS1 已切换为 WebSocket 协议。电话场景建议使用 `ulaw/alaw + 8000`;离线文件合成请优先使用当前页面可协商出的兼容格式。
-    </div>
+    <div class="alert alert-info" th:text="#{switchconf.tts.tx1.notice}"></div>
     <div id="baseConfigs"></div>
 
     <div class="row"></div>
@@ -38,6 +36,24 @@
         var value = config.value || '';
         var safeValue = escapeHtml(value);
 
+        if (name === 'sound-effect' || name === 'soundEffect') {
+            return '' +
+                '<select class="config-value form-control" id="' + name + '">' +
+                '<option value=""' + (value === '' ? ' selected' : '') + '>' + i18n('switchconf.tts.tx1.effect.none') + '</option>' +
+                '<option value="spacious_echo"' + (value === 'spacious_echo' ? ' selected' : '') + '>' + i18n('switchconf.tts.tx1.effect.spaciousEcho') + '</option>' +
+                '<option value="auditorium_echo"' + (value === 'auditorium_echo' ? ' selected' : '') + '>' + i18n('switchconf.tts.tx1.effect.auditoriumEcho') + '</option>' +
+                '<option value="lofi_telephone"' + (value === 'lofi_telephone' ? ' selected' : '') + '>' + i18n('switchconf.tts.tx1.effect.lofiTelephone') + '</option>' +
+                '<option value="robotic"' + (value === 'robotic' ? ' selected' : '') + '>' + i18n('switchconf.tts.tx1.effect.robotic') + '</option>' +
+                '</select>' +
+                '<span class="help-block m-b-none">' + i18n('switchconf.tts.tx1.help.soundEffect') + '</span>';
+        }
+
+        if (name === 'pitch' || name === 'intensity' || name === 'timbre') {
+            return '' +
+                '<input class="config-value form-control" type="number" id="' + name + '" min="-100" max="100" step="1" value="' + safeValue + '" />' +
+                '<span class="help-block m-b-none">' + i18n('switchconf.tts.tx1.help.effectRange') + '</span>';
+        }
+
         if (name === 'format') {
             return '' +
                 '<select class="config-value form-control" id="' + name + '">' +
@@ -49,7 +65,7 @@
                 '<option value="flac"' + (value === 'flac' ? ' selected' : '') + '>flac</option>' +
                 '<option value="opus"' + (value === 'opus' ? ' selected' : '') + '>opus</option>' +
                 '</select>' +
-                '<span class="help-block m-b-none">FS 实时播报只推荐 `ulaw/alaw/pcm`,最终以握手包协商结果为准。</span>';
+                '<span class="help-block m-b-none">' + i18n('switchconf.tts.tx1.help.format') + '</span>';
         }
 
         if (name === 'sample-rate') {
@@ -106,6 +122,18 @@
                 return false;
             }
         }
+        var effectKeys = ['pitch', 'intensity', 'timbre'];
+        for (var i = 0; i < effectKeys.length; i++) {
+            var key = effectKeys[i];
+            if (configMap[key] === undefined || configMap[key] === '') {
+                continue;
+            }
+            var num = parseInt(configMap[key], 10);
+            if (isNaN(num) || num < -100 || num > 100) {
+                $.modal.alertError('`' + key + '` ' + i18n('switchconf.tts.tx1.validate.effectRange'));
+                return false;
+            }
+        }
         return true;
     }
 

+ 10 - 2
sql/v20260616_tx_tts1.sql

@@ -25,8 +25,8 @@ DELETE FROM `cc_params`
 WHERE `param_code` = 'tx-tts1-account-json';
 
 INSERT INTO `cc_params` (`param_name`, `param_code`, `param_value`, `param_type`, `hide_value`)
-VALUES ('腾讯云tts账号参数json', 'tx-tts1-account-json', '{"appid":"","secret-id":"","secret-key":"","voice-id":"","websocket-host":"mps.cloud.tencent.com","text-lang":"zh","format":"ulaw","sample-rate":"8000","timeout-sec":"60","speed":"0","vol":"0","res-id":"","signature-expire-seconds":"3600","connect-timeout-ms":"10000","verify-peer":"false"}', 'tts', 1);
-
+VALUES ('腾讯云tts账号参数json', 'tx-tts1-account-json', '{"appid":"","secret-id":""
+,"secret-key":"","voice-id":"","websocket-host":"mps.cloud.tencent.com","text-lang":"zh","format":"ulaw","sample-rate":"8000","timeout-sec":"60","speed":"0","vol":"0","pitch":"","intensity":"","timbre":"","sound-effect":"","res-id":"","signature-expire-seconds":"3600","connect-timeout-ms":"10000","verify-peer":"false"}', 'tts', 1);
 DELETE FROM `fs_variables`
 WHERE `cat` = 5
   AND `var_field_name` IN (
@@ -41,6 +41,10 @@ WHERE `cat` = 5
     'timeout-sec',
     'speed',
     'vol',
+    'pitch',
+    'intensity',
+    'timbre',
+    'sound-effect',
     'res-id',
     'signature-expire-seconds',
     'connect-timeout-ms',
@@ -59,6 +63,10 @@ INSERT INTO `fs_variables` (`cat`, `var_field_name`, `var_field_alias`) VALUES
 (5, 'timeout-sec', '会话超时(秒)'),
 (5, 'speed', '语速'),
 (5, 'vol', '音量'),
+(5, 'pitch', '音高 Pitch'),
+(5, 'intensity', '强度 Intensity'),
+(5, 'timbre', '音色 Timbre'),
+(5, 'sound-effect', '音效 Effect'),
 (5, 'res-id', '资源标签'),
 (5, 'signature-expire-seconds', '签名有效期(秒)'),
 (5, 'connect-timeout-ms', '连接超时(毫秒)'),