This is a java based desktop application that can RECOGNIZE any live streaming in 21 languages that supported by VOSK then TRANSLATE and display it as LIVE SUBTITLES
java-vosk-livesubtitle.480p.mp4
This app was develepoed with Apache Netbeans IDE 15 https://netbeans.apache.org/download/index.html which using Oracle JRE v1.8.0_351 and SWING as its GUI framework.
The speech recognition part is using java vosk api https://github.com/alphacep/vosk-api/tree/master/java/lib/src/main/java/org/vosk
The translation part is using self made GoogleTranslator class
If you want to build this source to an exe file, you will need jar2exe https://www.jar2exe.com/
That build.gradle file must contain these lines beside other standard tags :
jar {
manifest {
attributes(
'Main-Class': 'org.vosk.LiveSubtitle'
)
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
}
After Clean And Build with Netbeans, goto that build\distribution folder and extract that zip file.
Then open jar2exe, browse to distributions\java-vosk-livesubtitle\lib folder, select java-vosk-livesubtitle.jar as source that you want to convert to exe
Choose Windows GUI Application if you don't want to see any log exception in DOS interface.
Add all other jar files in that lib folder except that java-vosk-livesubtitle.jar that you already set as main source.
Don't forget to check Create 64bits executivce to avoid libvosk dll errors
Then click Config Internal to set additional compile parameter UTF-8 enconding so you can see and translate Chinese and Japanese characters correctly.
Select Custom tab and paste this code :
option -Dfile.encoding=UTF-8
click Apply and OK, then Next to start compile.
The file java-vosk-livesubtitle.exe will be created on same folder of those jar filers (lib folder)
Now you can run this app in one single click.
Don't forget to put that models folder into same folder with java-vosk-livesubtitle.exe and also don't forget to extract those fonts I've included in compressed zip release file into C:\Windows\Fonts\ folder!
As usual for best recognizing quality, on windows you will need STEREO MIX or VIRTUAL AUDIO CABLE as RECORDING/INPUT DEVICE
and on linux you willl need PAVUCONTROL (by choosing MONITOR of your audio device as INPUT DEVICE)
MIT
Check my other SPEECH RECOGNITIION + TRANSLATE PROJECTS https://github.com/botbahlul?tab=repositories
Buy me coffee : https://sociabuzz.com/botbahlul/tribe