This commit is contained in:
2025-09-23 10:54:46 +08:00
parent e08cbe45d4
commit c23fc9f9f5
31 changed files with 661 additions and 477 deletions

View File

@@ -17,9 +17,9 @@ public class SpeechRecognitionWebSocketHandler {
public SpeechRecognitionWebSocketHandler() {
// 初始化语音识别器
String appKey = "LuvNcrddU3PH8Tau";
String id = "LTAI5tRBahK93vPNF1JDVEPA";
String secret = "x95OWb4cV6ccQVtbEJ2Gxm2Uwl2thJ";
String appKey = "4lFYn2yPsQymwGu8";
String id = "LTAI5t9hhSqdDHqwH3RjgyYj";
String secret = "ni5aW3vxrWouMwcGqJPfh9Uu56PBuv";
String url = System.getenv().getOrDefault("NLS_GATEWAY_URL", "wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1");
recognizerDemo = new SpeechRecognizerAI(appKey, id, secret, url);
}
@@ -44,6 +44,7 @@ public class SpeechRecognitionWebSocketHandler {
recognizerDemo.processStream(session, new ByteArrayInputStream(audioData), 16000);
}
/**
* 连接关闭调用的方法
*/