Skip to content

JAVA based DESKTOP APP that can RECOGNIZE any live streaming in 21 languages that supported by VOSK then TRANSLATE (using unofficial online Google Translate API) and display it as LIVE CAPTION / LIVE SUBTITLE

Notifications You must be signed in to change notification settings

botbahlul/java-vosk-livesubtitle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-vosk-livesubtitle

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 jar2exe-browse

Set JDK version to 1.8. jar2exe-set-jdk

Choose Windows GUI Application if you don't want to see any log exception in DOS interface. image

Add all other jar files in that lib folder except that java-vosk-livesubtitle.jar that you already set as main source. jar2exe-add-jar jar2exe-add-jar2

Don't forget to check Create 64bits executivce to avoid libvosk dll errors image

Then click Config Internal to set additional compile parameter UTF-8 enconding so you can see and translate Chinese and Japanese characters correctly. image

Select Custom tab and paste this code :

option -Dfile.encoding=UTF-8

jar2exe-set-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 image image image

and on linux you willl need PAVUCONTROL (by choosing MONITOR of your audio device as INPUT DEVICE) image

License

MIT

Check my other SPEECH RECOGNITIION + TRANSLATE PROJECTS https://github.com/botbahlul?tab=repositories

Buy me coffee : https://sociabuzz.com/botbahlul/tribe

About

JAVA based DESKTOP APP that can RECOGNIZE any live streaming in 21 languages that supported by VOSK then TRANSLATE (using unofficial online Google Translate API) and display it as LIVE CAPTION / LIVE SUBTITLE

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages