Add Java and Kotlin API for sense voice (#1164)

This commit is contained in:
Fangjun Kuang
2024-07-22 14:08:40 +08:00
committed by GitHub
parent ac8223bd8a
commit dd300b1de5
16 changed files with 601 additions and 2 deletions

View File

@@ -167,6 +167,12 @@ function testSpokenLanguageIdentification() {
}
function testOfflineAsr() {
if [ ! -f ./sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17/tokens.txt ]; then
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.bz2
tar xvf sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.bz2
rm sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.bz2
fi
if [ ! -f ./sherpa-onnx-whisper-tiny.en/tiny.en-encoder.int8.onnx ]; then
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-whisper-tiny.en.tar.bz2
tar xvf sherpa-onnx-whisper-tiny.en.tar.bz2

View File

@@ -1,7 +1,7 @@
package com.k2fsa.sherpa.onnx
fun main() {
val types = arrayOf(0, 2, 5, 6)
val types = arrayOf(0, 2, 5, 6, 15)
for (type in types) {
test(type)
}
@@ -15,6 +15,7 @@ fun test(type: Int) {
2 -> "./sherpa-onnx-whisper-tiny.en/test_wavs/0.wav"
5 -> "./sherpa-onnx-zipformer-multi-zh-hans-2023-9-2/test_wavs/1.wav"
6 -> "./sherpa-onnx-nemo-ctc-en-citrinet-512/test_wavs/8k.wav"
15 -> "./sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17/test_wavs/zh.wav"
else -> null
}