Add JavaScript API (wasm) for speech enhancement GTCRN models (#2007)
This commit is contained in:
@@ -9,6 +9,10 @@ const sherpa_onnx_wave = require('./sherpa-onnx-wave.js');
|
||||
const sherpa_onnx_vad = require('./sherpa-onnx-vad.js');
|
||||
const sherpa_onnx_speaker_diarization =
|
||||
require('./sherpa-onnx-speaker-diarization.js');
|
||||
const sherpa_onnx_speech_enhancement =
|
||||
require('./sherpa-onnx-speech-enhancement.js');
|
||||
|
||||
|
||||
|
||||
function createOnlineRecognizer(config) {
|
||||
return sherpa_onnx_asr.createOnlineRecognizer(wasmModule, config);
|
||||
@@ -47,6 +51,15 @@ function writeWave(filename, data) {
|
||||
sherpa_onnx_wave.writeWave(filename, data, wasmModule);
|
||||
}
|
||||
|
||||
function readWaveFromBinaryData(uint8Array) {
|
||||
return sherpa_onnx_wave.readWaveFromBinaryData(uint8Array, wasmModule);
|
||||
}
|
||||
|
||||
function createOfflineSpeechDenoiser(config) {
|
||||
return sherpa_onnx_speech_enhancement.createOfflineSpeechDenoiser(
|
||||
wasmModule, config);
|
||||
}
|
||||
|
||||
// Note: online means streaming and offline means non-streaming here.
|
||||
// Both of them don't require internet connection.
|
||||
module.exports = {
|
||||
@@ -55,8 +68,10 @@ module.exports = {
|
||||
createOfflineTts,
|
||||
createKws,
|
||||
readWave,
|
||||
readWaveFromBinaryData,
|
||||
writeWave,
|
||||
createCircularBuffer,
|
||||
createVad,
|
||||
createOfflineSpeakerDiarization,
|
||||
createOfflineSpeechDenoiser,
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "sherpa-onnx",
|
||||
"version": "SHERPA_ONNX_VERSION",
|
||||
"description": "Speech-to-text and text-to-speech using Next-gen Kaldi without internet connection",
|
||||
"description": "Speech-to-text, text-to-speech, speaker diarization, and speech enhancement using Next-gen Kaldi without internet connection",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
@@ -34,7 +34,9 @@
|
||||
"speech",
|
||||
"recognition",
|
||||
"WebAssembly",
|
||||
"wasm"
|
||||
"wasm",
|
||||
"speech enhancement",
|
||||
"denoising"
|
||||
],
|
||||
"author": "The next-gen Kaldi team",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
Reference in New Issue
Block a user