mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-14 20:33:40 +00:00
完成火山引擎适配
This commit is contained in:
@@ -1,4 +1,16 @@
|
||||
package org.ruoyi.aihuman.config;
|
||||
|
||||
public class WebConfig {
|
||||
}
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
// 映射/voice/**路径到classpath:/voice/目录
|
||||
registry.addResourceHandler("/voice/**")
|
||||
.addResourceLocations("classpath:/voice/")
|
||||
.setCachePeriod(3600);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,21 @@
|
||||
package org.ruoyi.aihuman.domain;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 语音请求参数实体类
|
||||
*/
|
||||
@Data
|
||||
public class VoiceRequest {
|
||||
}
|
||||
|
||||
@JsonProperty("ENDPOINT")
|
||||
private String endpoint;
|
||||
private String appId;
|
||||
private String accessToken;
|
||||
private String resourceId;
|
||||
private String voice;
|
||||
private String text;
|
||||
private String encoding;
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.speech.protocol;
|
||||
package org.ruoyi.aihuman.protocol;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.speech.protocol;
|
||||
package org.ruoyi.aihuman.protocol;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.speech.protocol;
|
||||
package org.ruoyi.aihuman.protocol;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.speech.protocol;
|
||||
package org.ruoyi.aihuman.protocol;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.speech.protocol;
|
||||
package org.ruoyi.aihuman.protocol;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.speech.protocol;
|
||||
package org.ruoyi.aihuman.protocol;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.speech.protocol;
|
||||
package org.ruoyi.aihuman.protocol;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.speech.protocol;
|
||||
package org.ruoyi.aihuman.protocol;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.java_websocket.client.WebSocketClient;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.speech.protocol;
|
||||
package org.ruoyi.aihuman.protocol;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.speech.volcengine;
|
||||
package org.ruoyi.aihuman.volcengine;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.speech.protocol.EventType;
|
||||
import com.speech.protocol.Message;
|
||||
import com.speech.protocol.MsgType;
|
||||
import com.speech.protocol.SpeechWebSocketClient;
|
||||
import org.ruoyi.aihuman.protocol.EventType;
|
||||
import org.ruoyi.aihuman.protocol.Message;
|
||||
import org.ruoyi.aihuman.protocol.MsgType;
|
||||
import org.ruoyi.aihuman.protocol.SpeechWebSocketClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@@ -40,7 +40,7 @@ public class Bidirection {
|
||||
String accessToken = System.getProperty("accessToken", "fOHuq4R4dirMYiOruCU3Ek9q75zV0KVW");
|
||||
String resourceId = System.getProperty("resourceId", "seed-tts-2.0");
|
||||
String voice = System.getProperty("voice", "zh_female_vv_uranus_bigtts");
|
||||
String text = System.getProperty("text", "你好呀!如果你有关于老婆相关的问题,比如怎么让她开心、怎么照顾她等,都可以跟我说哦,我会根据【马斯克·陈】提供的关爱老婆百事通里的信息给你分析和建议哒。");
|
||||
String text = System.getProperty("text", "你好呀!我是AI合成的语音,很高兴认识你。");
|
||||
String encoding = System.getProperty("encoding", "mp3");
|
||||
|
||||
if (appId.isEmpty() || accessToken.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user