feat: 优化语音速度

This commit is contained in:
liqupan
2025-12-06 22:42:05 +08:00
parent 7fe4b05cf8
commit 309b1318a7
7 changed files with 1523 additions and 6 deletions

View File

@@ -1,11 +1,32 @@
// API配置统一管理
export const API_CONFIG = {
// 基础API地址
BASE_URL: 'https://api.aixsy.com.cn',
BASE_URL: 'http://192.168.3.13:8091',
// WebSocket地址
WS_BASE_URL: 'ws://192.168.3.13:8091',
// 其他服务地址(如果需要)
WEB_URL: 'https://www.aixsy.com.cn',
// 🧪 测试模式配置
TEST_MODE: {
// 是否启用测试模式true: 显示测试按钮,禁用录音; false: 正常录音模式)
enabled: false,
// 📝 测试音频数据base64编码的PCM数据
// 格式要求:
// - 采样率: 16000 Hz
// - 位深度: 16 bit (有符号整数)
// - 声道数: 1 (单声道)
// - 字节序: Little Endian (小端序)
// - 无文件头纯PCM数据
testAudioBase64: '', // 👈 在这里填入你的base64编码的PCM数据
// 或者使用文件路径优先使用base64
testAudioPath: 'src/static/output.pcm', // 例如: '/static/test_audio.pcm'
},
// API端点
ENDPOINTS: {
// 登录相关
@@ -44,6 +65,11 @@ export const API_CONFIG = {
CONFIG_TTS: '/app/config/tts'
},
// WebSocket端点
WS_ENDPOINTS: {
VOICE_STREAM: '/ws/voice-stream'
},
// 请求超时时间(毫秒)
TIMEOUT: 30000,
@@ -61,3 +87,8 @@ export const getWebUrl = (endpoint) => {
return API_CONFIG.WEB_URL + endpoint;
};
// 导出WebSocket URL构建函数
export const getWsUrl = (endpoint) => {
return API_CONFIG.WS_BASE_URL + endpoint;
};