Browse Source

重复10次5

TitanWong 1 year ago
parent
commit
1cdf598d7b

+ 1 - 0
Dockerfile

@@ -4,6 +4,7 @@ FROM nas.fast-fun.cn:5000/station-control/tts:0.2
 ENV LANG C.UTF-8
 #RUN mkdir -p /home/download/excel
 COPY ./lib /home/lib
+RUN echo -e "#bin/bash\nwhile true\ndo\n\tplay -v \$2 \$1\ndone" >/home/playMusic.sh
 
 COPY ./target/zhili-station-control-tts-1.0-SNAPSHOT.jar /home/App.jar
 

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

@@ -24,7 +24,8 @@ public class MusicServiceImpl implements MusicService {
     public Integer start(String path, Integer vol) {
         stop();
         try {
-            String cmd = "play -v "+Float.valueOf(new Integer(vol).toString())/100+" "+path+" repeat 10";
+//            String cmd = "play -v "+Float.valueOf(new Integer(vol).toString())/100+" "+path+" repeat 10";
+            String cmd = "/home/playMusic.sh "+path+" "+vol;
             log.info("cmd:{}",cmd);
             p = Runtime.getRuntime().exec(cmd);
             return 0;