瀏覽代碼

重复10次11

TitanWong 1 年之前
父節點
當前提交
97c936abc3
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/main/java/com/zhili/stationcontrol/tts/service/impl/MusicServiceImpl.java

+ 3 - 2
src/main/java/com/zhili/stationcontrol/tts/service/impl/MusicServiceImpl.java

@@ -34,7 +34,7 @@ public class MusicServiceImpl implements MusicService {
     @Override
     public Integer start(String path, Integer vol) {
         synchronized (this) {
-            log.info("start music cmd:{}",cmd);
+            log.info("start music cmd:{}", cmd);
             cmd = "play -v " + Float.valueOf(new Integer(vol).toString()) / 100 + " " + path;
             startCmd = true;
             repeat = true;
@@ -80,7 +80,8 @@ public class MusicServiceImpl implements MusicService {
     @Scheduled(fixedRate = 500)
     public void repeat() {
         synchronized (this) {
-            if (p == null && cmd != null) {
+            if (repeat && p == null && cmd != null) {
+                log.info("repeat:{}", cmd);
                 try {
                     p = Runtime.getRuntime().exec(cmd);
                 } catch (IOException e) {