整个课程和数据UI重新设计版本

This commit is contained in:
shenlei
2026-09-18 17:55:44 +09:00
parent febfd30f49
commit 0a4f97d105
154 changed files with 12366 additions and 4784 deletions
+24 -15
View File
@@ -41,7 +41,8 @@ void main() {
final recognizer = sherpa_onnx.OfflineRecognizer(recognizerConfig);
const testWave = '/tmp/sherpa_test/sherpa-onnx-zipformer-small-en-2023-06-26/test_wavs/0.wav';
const testWave =
'/tmp/sherpa_test/sherpa-onnx-zipformer-small-en-2023-06-26/test_wavs/0.wav';
if (File(testWave).existsSync()) {
final wave = sherpa_onnx.readWave(testWave);
expect(wave.samples.isNotEmpty, isTrue);
@@ -57,19 +58,27 @@ void main() {
recognizer.free();
});
test('SherpaSttService singleton initializes and transcribes cleanly', () async {
final ready = await SherpaSttService.instance.initialize(nativeLibDir: macosDir);
expect(ready, isTrue);
expect(SherpaSttService.instance.isReady, isTrue);
test(
'SherpaSttService singleton initializes and transcribes cleanly',
() async {
final ready = await SherpaSttService.instance.initialize(
nativeLibDir: macosDir,
);
expect(ready, isTrue);
expect(SherpaSttService.instance.isReady, isTrue);
const testWave = '/tmp/sherpa_test/sherpa-onnx-zipformer-small-en-2023-06-26/test_wavs/0.wav';
if (File(testWave).existsSync()) {
final transcribed = await SherpaSttService.instance.transcribeWav(testWave);
expect(transcribed, isNotNull);
print('SherpaSttService transcribed: $transcribed');
expect(transcribed!.toLowerCase().contains('nightfall'), isTrue);
// SenseVoice tags should be stripped
expect(transcribed.contains('<|'), isFalse);
}
});
const testWave =
'/tmp/sherpa_test/sherpa-onnx-zipformer-small-en-2023-06-26/test_wavs/0.wav';
if (File(testWave).existsSync()) {
final transcribed = await SherpaSttService.instance.transcribeWav(
testWave,
);
expect(transcribed, isNotNull);
print('SherpaSttService transcribed: $transcribed');
expect(transcribed!.toLowerCase().contains('nightfall'), isTrue);
// SenseVoice tags should be stripped
expect(transcribed.contains('<|'), isFalse);
}
},
);
}