Skip to content

Commit

Permalink
build(deps): Bump jna.version from 5.9.0 to 5.14.0 (#982)
Browse files Browse the repository at this point in the history
* build(deps): Bump jna.version from 5.9.0 to 5.14.0

Bumps `jna.version` from 5.9.0 to 5.14.0.

Updates `net.java.dev.jna:jna` from 5.9.0 to 5.14.0
- [Changelog](https://github.com/java-native-access/jna/blob/master/CHANGES.md)
- [Commits](java-native-access/jna@5.9.0...5.14.0)

Updates `net.java.dev.jna:jna-platform` from 5.9.0 to 5.14.0
- [Changelog](https://github.com/java-native-access/jna/blob/master/CHANGES.md)
- [Commits](java-native-access/jna@5.9.0...5.14.0)

---
updated-dependencies:
- dependency-name: net.java.dev.jna:jna
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: net.java.dev.jna:jna-platform
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: VoskUtil error

Signed-off-by: unknowIfGuestInDream <[email protected]>

* style: style code

Signed-off-by: unknowIfGuestInDream <[email protected]>

* style: style code

Signed-off-by: unknowIfGuestInDream <[email protected]>

* style: style code

Signed-off-by: unknowIfGuestInDream <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: unknowIfGuestInDream <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: unknowIfGuestInDream <[email protected]>
  • Loading branch information
dependabot[bot] and unknowIfGuestInDream authored Dec 16, 2023
1 parent 3ccd563 commit d7362c7
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 9 deletions.
38 changes: 33 additions & 5 deletions core/src/main/java/com/tlcsdm/core/util/VoskUtil.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
/*
* Copyright (c) 2023 unknowIfGuestInDream.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of unknowIfGuestInDream, any associated website, nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL UNKNOWIFGUESTINDREAM BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package com.tlcsdm.core.util;

import cn.hutool.core.io.FileUtil;
Expand All @@ -21,12 +48,13 @@
import java.util.List;

/**
* vosk工具类.
*
* @author unknowIfGuestInDream
* vosk 工具类.
*/
public class VoskUtil {

private VoskUtil() {
}

/**
* 获取wav音频文件文本.
*/
Expand All @@ -35,10 +63,10 @@ public static List<String> decoder(String wavPath, String modalPath) {
throw new CoreException("Only WAV audio files are supported.");
}
List<String> list = new ArrayList<>();
System.setProperty("jna.encoding", CoreConstant.ENCODING_UTF_8);
LibVosk.setLogLevel(LogLevel.INFO);
try (Model model = new Model(modalPath);
InputStream ais = AudioSystem.getAudioInputStream(new BufferedInputStream
(new FileInputStream(wavPath)));
InputStream ais = AudioSystem.getAudioInputStream(new BufferedInputStream(new FileInputStream(wavPath)));
Recognizer recognizer = new Recognizer(model, 16000)) {
int nbytes;
byte[] b = new byte[4096];
Expand Down
12 changes: 9 additions & 3 deletions jenkins/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ $M2_HOME/bin/mvn -f ${mod}/pom.xml -s $M2_HOME/conf/settings.xml -Djavafx.platfo
cp ${mod}/target/javafxTool-${mod}.jar javafxTool-${mod}.jar
cp -r ${mod}/target/lib lib
cp -r ${mod}/target/apidocs apidocs
zip -r ${mod}Tool-win_b${BUILD_NUMBER}_$(date +%Y%m%d).zip docs javafxTool-${mod}.jar lib apidocs LICENSE
cp -r ${mod}/target/license license
zip -r ${mod}Tool-win_b${BUILD_NUMBER}_$(date +%Y%m%d).zip docs javafxTool-${mod}.jar lib apidocs license
zip -uj ${mod}Tool-win_b${BUILD_NUMBER}_$(date +%Y%m%d).zip jenkins/window/${mod}/*
rm javafxTool-${mod}.jar
rm -r lib
rm -r apidocs
rm -r license
done

$M2_HOME/bin/mvn -f pom.xml -s $M2_HOME/conf/settings.xml -Djavafx.platform=mac -Dmaven.test.skip=true clean install
Expand All @@ -56,11 +58,13 @@ $M2_HOME/bin/mvn -f ${mod}/pom.xml -s $M2_HOME/conf/settings.xml -Djavafx.platfo
cp ${mod}/target/javafxTool-${mod}.jar javafxTool-${mod}.jar
cp -r ${mod}/target/lib lib
cp -r ${mod}/target/apidocs apidocs
zip -r ${mod}Tool-mac_b${BUILD_NUMBER}_$(date +%Y%m%d).zip docs javafxTool-${mod}.jar lib apidocs LICENSE
cp -r ${mod}/target/license license
zip -r ${mod}Tool-mac_b${BUILD_NUMBER}_$(date +%Y%m%d).zip docs javafxTool-${mod}.jar lib apidocs license
zip -uj ${mod}Tool-mac_b${BUILD_NUMBER}_$(date +%Y%m%d).zip jenkins/mac/${mod}/*
rm javafxTool-${mod}.jar
rm -r lib
rm -r apidocs
rm -r license
done

$M2_HOME/bin/mvn -f pom.xml -s $M2_HOME/conf/settings.xml -Djavafx.platform=linux -Dmaven.test.skip=true clean install
Expand All @@ -71,9 +75,11 @@ $M2_HOME/bin/mvn -f ${mod}/pom.xml -s $M2_HOME/conf/settings.xml -Djavafx.platfo
cp ${mod}/target/javafxTool-${mod}.jar javafxTool-${mod}.jar
cp -r ${mod}/target/lib lib
cp -r ${mod}/target/apidocs apidocs
zip -r ${mod}Tool-linux_b${BUILD_NUMBER}_$(date +%Y%m%d).zip docs javafxTool-${mod}.jar lib apidocs LICENSE
cp -r ${mod}/target/license license
zip -r ${mod}Tool-linux_b${BUILD_NUMBER}_$(date +%Y%m%d).zip docs javafxTool-${mod}.jar lib apidocs license
zip -uj ${mod}Tool-linux_b${BUILD_NUMBER}_$(date +%Y%m%d).zip jenkins/linux/${mod}/*
rm javafxTool-${mod}.jar
rm -r lib
rm -r apidocs
rm -r license
done
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<yuicompressor.version>2.4.8</yuicompressor.version>
<jface.version>3.32.0</jface.version>
<swt.version>3.124.200</swt.version>
<jna.version>5.9.0</jna.version>
<jna.version>5.14.0</jna.version>
<vosk.version>0.3.45</vosk.version>
<java2.version>3.4.0</java2.version>
<jakarta.xml.bind-api.version>4.0.1</jakarta.xml.bind-api.version>
Expand Down

0 comments on commit d7362c7

Please sign in to comment.