lyledean1 / flutter_whisper.cpp

Flutter App That Can Transcribe Audio Offline/On Device with Whisper C++ Bindings via Rust
MIT License
102 stars 10 forks source link

Question of Change Language #12

Closed JarrenPoh closed 10 months ago

JarrenPoh commented 10 months ago

Hi, I want to know how can I change the language mode? And I also want to know can I use all these in release APP?

jungsu0717 commented 10 months ago

Hi, I want to know how can I change the language mode? And I also want to know can I use all these in release APP?

On a Mac (M1 silicon chip) building only in ARM64 arch.

Also, to set the language, you need to change Rust code. See the page below https://docs.rs/whisper-rs/latest/whisper_rs/struct.FullParams.html#method.set_language

lyledean1 commented 10 months ago

This is straight forward to add as a feature, you just need to pass the value through the FFI function from Dart -> Rust. I've added it in this PR https://github.com/lyledean1/flutter_whisper.cpp/pull/13 . See the updated code here. You also need to make sure you use the correct model, i.e tiny instead of tiny.en - see OpenAIs docs

In terms of running in production, release mode works for iOS, not for MacOS currently. Android still needs to be set up. I haven't ran this in production myself so can't give you any tips apart from the fact you will probably have a large binary size if you include the model file in your build.