Commit f3af1893189fb9432b6e7871990134a6f9d643f9
1 parent
95533bc2
1.解决报站语音生成在centos7下异常问题
Showing
2 changed files
with
24 additions
and
36 deletions
pom.xml
| @@ -442,10 +442,23 @@ | @@ -442,10 +442,23 @@ | ||
| 442 | <version>1.5.3</version> | 442 | <version>1.5.3</version> |
| 443 | </dependency> | 443 | </dependency> |
| 444 | 444 | ||
| 445 | + <!-- 核心依赖 --> | ||
| 445 | <dependency> | 446 | <dependency> |
| 446 | <groupId>org.bytedeco</groupId> | 447 | <groupId>org.bytedeco</groupId> |
| 447 | - <artifactId>javacv-platform</artifactId> | ||
| 448 | - <version>1.5.11</version> | 448 | + <artifactId>javacv</artifactId> |
| 449 | + <version>1.5.5</version> | ||
| 450 | + </dependency> | ||
| 451 | + <dependency> | ||
| 452 | + <groupId>org.bytedeco</groupId> | ||
| 453 | + <artifactId>javacpp</artifactId> | ||
| 454 | + <version>1.5.5</version> | ||
| 455 | + </dependency> | ||
| 456 | + <!-- Linux x86_64平台特定的FFmpeg依赖 --> | ||
| 457 | + <dependency> | ||
| 458 | + <groupId>org.bytedeco</groupId> | ||
| 459 | + <artifactId>ffmpeg</artifactId> | ||
| 460 | + <version>4.3.2-1.5.5</version> | ||
| 461 | + <classifier>${javacpp.platform}</classifier> | ||
| 449 | </dependency> | 462 | </dependency> |
| 450 | </dependencies> | 463 | </dependencies> |
| 451 | 464 | ||
| @@ -489,35 +502,10 @@ | @@ -489,35 +502,10 @@ | ||
| 489 | </resource> | 502 | </resource> |
| 490 | </resources> | 503 | </resources> |
| 491 | </build> | 504 | </build> |
| 492 | - <repositories> | ||
| 493 | - <repository> | ||
| 494 | - <id>spring-snapshots</id> | ||
| 495 | - <url>http://repo.spring.io/snapshot</url> | ||
| 496 | - <snapshots> | ||
| 497 | - <enabled>true</enabled> | ||
| 498 | - </snapshots> | ||
| 499 | - </repository> | ||
| 500 | - <repository> | ||
| 501 | - <id>spring-milestones</id> | ||
| 502 | - <url>http://repo.spring.io/milestone</url> | ||
| 503 | - </repository> | ||
| 504 | - <repository> | ||
| 505 | - <id>pentaho-public</id> | ||
| 506 | - <url>https://repo.orl.eng.hitachivantara.com/artifactory/pnt-mvn/</url> | ||
| 507 | - </repository> | ||
| 508 | - </repositories> | ||
| 509 | - <pluginRepositories> | ||
| 510 | - <pluginRepository> | ||
| 511 | - <id>spring-snapshots</id> | ||
| 512 | - <url>http://repo.spring.io/snapshot</url> | ||
| 513 | - </pluginRepository> | ||
| 514 | - <pluginRepository> | ||
| 515 | - <id>spring-milestones</id> | ||
| 516 | - <url>http://repo.spring.io/milestone</url> | ||
| 517 | - </pluginRepository> | ||
| 518 | - </pluginRepositories> | ||
| 519 | 505 | ||
| 520 | <properties> | 506 | <properties> |
| 521 | <start-class>com.bsth.Application</start-class> | 507 | <start-class>com.bsth.Application</start-class> |
| 508 | + <!-- 平台配置,只打包Linux x86_64平台的jar包 --> | ||
| 509 | + <javacpp.platform>linux-x86_64</javacpp.platform> | ||
| 522 | </properties> | 510 | </properties> |
| 523 | </project> | 511 | </project> |
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
| @@ -436,11 +436,11 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -436,11 +436,11 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 436 | List<LineRegion> lineRegions = lineRegionRepository.findAll(new CustomerSpecs<>(param)); | 436 | List<LineRegion> lineRegions = lineRegionRepository.findAll(new CustomerSpecs<>(param)); |
| 437 | if (objects.size()>0) { | 437 | if (objects.size()>0) { |
| 438 | // 报站音频 | 438 | // 报站音频 |
| 439 | -// Set<String> languages = new HashSet<>(); | ||
| 440 | -// languages.add("cn"); | ||
| 441 | -// languages.add("sh"); | ||
| 442 | -// languages.add("en"); | ||
| 443 | -// InputStream tts = ttsAndZip(objects, line, languages); | 439 | + Set<String> languages = new HashSet<>(); |
| 440 | + languages.add("cn"); | ||
| 441 | + languages.add("sh"); | ||
| 442 | + languages.add("en"); | ||
| 443 | + InputStream tts = ttsAndZip(objects, line, languages); | ||
| 444 | /** 获取配置文件里的ftp登录参数 */ | 444 | /** 获取配置文件里的ftp登录参数 */ |
| 445 | Map<String, Object> FTPParamMap = readPropertiesGetFTPParam(); | 445 | Map<String, Object> FTPParamMap = readPropertiesGetFTPParam(); |
| 446 | // 压缩文件名 | 446 | // 压缩文件名 |
| @@ -519,8 +519,8 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -519,8 +519,8 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 519 | } | 519 | } |
| 520 | 520 | ||
| 521 | 521 | ||
| 522 | -// clientUtils.deleteFtpFile(url, port, username, password, remotePath + "/voice/", String.format("%s.zip", line.getLineCode())); | ||
| 523 | -// clientUtils.uploadFile(url, port, username, password, remotePath + "/voice/", String.format("%s.zip", line.getLineCode()), tts); | 522 | + clientUtils.deleteFtpFile(url, port, username, password, remotePath + "/voice/", String.format("%s.zip", line.getLineCode())); |
| 523 | + clientUtils.uploadFile(url, port, username, password, remotePath + "/voice/", String.format("%s.zip", line.getLineCode()), tts); | ||
| 524 | 524 | ||
| 525 | resultMap.put("status", ResponseCode.SUCCESS); | 525 | resultMap.put("status", ResponseCode.SUCCESS); |
| 526 | }else { | 526 | }else { |