Class WhisperCppEngine
java.lang.Object
org.opencastproject.speechtotext.impl.engine.WhisperCppEngine
- All Implemented Interfaces:
SpeechToTextEngine
WhisperC++ implementation of the Speech-to-text engine interface.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opencastproject.speechtotext.api.SpeechToTextEngine
SpeechToTextEngine.Result -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default path to the ffmpeg binarystatic final StringThe key to look for in the service configuration file to override the DEFAULT_FFMPEG_BINARYprotected StringPath to the executablestatic final StringDefault path to WhisperC++.static final StringDefault whispercpp model -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
WHISPERCPP_EXECUTABLE_DEFAULT_PATH
Default path to WhisperC++.- See Also:
-
WHISPERCPP_MODEL_DEFAULT
Default whispercpp model- See Also:
-
FFMPEG_BINARY_CONFIG_KEY
The key to look for in the service configuration file to override the DEFAULT_FFMPEG_BINARY- See Also:
-
DEFAULT_FFMPEG_BINARY
The default path to the ffmpeg binary- See Also:
-
ffmpegBinary
Path to the executable
-
-
Constructor Details
-
WhisperCppEngine
public WhisperCppEngine()
-
-
Method Details
-
getEngineName
Description copied from interface:SpeechToTextEngineReturns the name of the implemented engine.- Specified by:
getEngineNamein interfaceSpeechToTextEngine- Returns:
- The name of the implemented engine.
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) -
generateSubtitlesFile
public SpeechToTextEngine.Result generateSubtitlesFile(File mediaFile, File workingDirectory, String language, Boolean translate) throws SpeechToTextEngineException Generates the subtitles file.- Specified by:
generateSubtitlesFilein interfaceSpeechToTextEngine- Parameters:
mediaFile- The media package containing the audio track.workingDirectory- A unique working directory to safely operate in.language- The language of the audio track.translate- If the subtitles should be translated into english- Returns:
- Result containing the language code and the subtitles file path.
- Throws:
SpeechToTextEngineException- Thrown when an error occurs at the process.- See Also:
-