Add JNI (#57)
This commit is contained in:
17
.github/scripts/WaveReader.kt
vendored
Normal file
17
.github/scripts/WaveReader.kt
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.k2fsa.sherpa.onnx
|
||||
|
||||
import android.content.res.AssetManager
|
||||
|
||||
class WaveReader {
|
||||
companion object {
|
||||
// Read a mono wave file.
|
||||
// No resampling is made.
|
||||
external fun readWave(
|
||||
assetManager: AssetManager, filename: String, expected_sample_rate: Float = 16000.0f
|
||||
): FloatArray?
|
||||
|
||||
init {
|
||||
System.loadLibrary("sherpa-onnx-jni")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user