客户管理功能调整, 音频模型调整
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
package com.rj;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class Langchain4jHeima20250803ApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -241,5 +241,6 @@ public class FaceDetectImageCountTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.rj.service;
|
||||
|
||||
import com.rj.dto.AsrRequest;
|
||||
import com.rj.dto.AsrResponse;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
/**
|
||||
* TtsRequestLogService ASR功能测试类
|
||||
*
|
||||
* @author rj
|
||||
* @date 2025-01-02
|
||||
*/
|
||||
@SpringBootTest
|
||||
public class TtsRequestLogServiceAsrTest {
|
||||
|
||||
@Autowired
|
||||
private ITtsRequestLogService ttsRequestLogService;
|
||||
|
||||
@Test
|
||||
public void testSpeechToText() {
|
||||
// 创建测试请求
|
||||
AsrRequest request = new AsrRequest();
|
||||
request.setAudioUrl("https://api.huayang-star.com/api/audio/1957424645898579969_a2db5d76-b52c-4289-9c7e-ed55d7f15e42.mp3");
|
||||
request.setModel("paraformer-v2");
|
||||
request.setFormat("mp3");
|
||||
request.setSampleRate(16000);
|
||||
request.setEnablePunctuation(true);
|
||||
request.setEnableNumberConversion(true);
|
||||
request.setCreatorName("测试用户");
|
||||
request.setCreatorPhone("13800138000");
|
||||
request.setAudioName("测试音频");
|
||||
|
||||
// 执行语音识别
|
||||
AsrResponse response = ttsRequestLogService.speechToText(request);
|
||||
|
||||
// 打印结果
|
||||
System.out.println("识别结果: " + response.isSuccess());
|
||||
System.out.println("识别文本: " + response.getText());
|
||||
System.out.println("处理时间: " + response.getProcessingTimeMs() + "ms");
|
||||
System.out.println("任务ID: " + response.getTaskId());
|
||||
System.out.println("请求ID: " + response.getRequestId());
|
||||
|
||||
if (response.getResults() != null && !response.getResults().isEmpty()) {
|
||||
System.out.println("结果详情:");
|
||||
for (AsrResponse.AsrResult result : response.getResults()) {
|
||||
System.out.println(" 文本: " + result.getText());
|
||||
System.out.println(" 开始时间: " + result.getStartTime());
|
||||
System.out.println(" 结束时间: " + result.getEndTime());
|
||||
System.out.println(" 说话人ID: " + result.getSpeakerId());
|
||||
System.out.println(" 置信度: " + result.getConfidence());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAsrServiceAvailable() {
|
||||
boolean available = ttsRequestLogService.isAsrServiceAvailable();
|
||||
System.out.println("ASR服务是否可用: " + available);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,5 +182,6 @@ public class TtsRequestLogShortUrlTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -160,5 +160,6 @@ public class VideoSynthesisTempUrlTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -135,5 +135,6 @@ public class VideoSynthesisVideoNameTest {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user