From 8b52f65dd3fbfa58064de85ab78237335b9de911 Mon Sep 17 00:00:00 2001 From: abb128 Date: Thu, 27 Feb 2025 23:13:31 +0200 Subject: [PATCH] Update README --- README.md | 58 ++++++++++++++++++++++++++++++++++++++++++++--------- example.cpp | 3 +++ 2 files changed, 51 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f281eb4..909e7c7 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,50 @@ [Documentation](https://abb128.github.io/april-asr/concepts.html) ## Status -This library is currently under development. Some features are unimplemented, it may have bugs and crashes, and there may be significant changes to the API. It may not yet be production-ready. +This library is currently facing some major rewrites over 2025 to improve efficiency and properly fulfill the API contract of multi-session support. The model format is going to change. -Furthermore, there's only one model that only does English and has some accuracy issues at that. +## Language support +The core library is written in C, and has a C API. [Python](https://abb128.github.io/april-asr/python.html) and [C#](https://abb128.github.io/april-asr/csharp.html) bindings are available. -### Language support -The library has a C API, and there are C# and Python bindings available, but these may not be stable yet. +## Example in Python -## Example +Install via `pip install april-asr` + +```py +import april_asr as april +import librosa + +# Change these values +model_path = "aprilv0_en-us.april" +audio_path = "audio.wav" + +model = april.Model(model_path) + + +def handler(result_type, tokens): + s = "" + for token in tokens: + s = s + token.token + + if result_type == april.Result.FINAL_RECOGNITION: + print("@"+s) + elif result_type == april.Result.PARTIAL_RECOGNITION: + print("-"+s) + else: + print("") + +session = april.Session(model, handler) + +data, sr = librosa.load(audio_path, sr=model.get_sample_rate(), mono=True) +data = (data * 32767).astype("short").astype(" #include #include