Browse Source

重复10次11

TitanWong 1 year ago
parent
commit
97c936abc3

+ 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) {