Browse Source

音频测试

jek 4 months ago
parent
commit
3bf54c9a94

+ 2 - 1
src/main/java/com/zhili/stationcontrol/tts/controller/TtsController.java

@@ -90,7 +90,7 @@ public class TtsController {
     }
 
     @GetMapping("/music")
-    public void music() throws UnsupportedAudioFileException, IOException, LineUnavailableException, InterruptedException {
+    public String music() throws UnsupportedAudioFileException, IOException, LineUnavailableException, InterruptedException {
         File file = new File("/static/wav/hdzqdd.wav");
         // 创建一个AudioInputStream
         AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(file);
@@ -105,5 +105,6 @@ public class TtsController {
         clip.drain();
         // 关闭声卡
         clip.close();
+        return "ok";
     }
 }