Draws subtitles from an .SRT (or plain text) into a formatted styled paragraph with fading opacity and more.
Branches ahead of develop
These branches have commits not yet on develop — could be unmerged fixes or work in progress worth a look.
README
OVERVIEW
Ready to use customizable
.SRT text subtitle (and plain text) player for openFrameworks. FEATURES
- Full
.SRTfile browser for exploring the dialogs. Text Modefor importing.txt. files. Split file in blocks then used as slides.- Fast
FontStashrender. - Custom
Paragraph Styles. - Scalable and draggable
rectangle container. - All
settings are persistent. - Animated
Fade In/Outfor transparency. Transport time playerwith four modes:- STANDALONE
- Dialogs following the original
SRTtimes and durations. - FORCED
- Customizable dialogs duration. Ignoring
SRTtimes. Ideal forTextmode. - EXTERNAL
- Time is controlled by a video player or linked to one external control.
- MANUAL
- To work without loading any
SRTfile. Just pass the text slides manually. Presets Enginefor all the settings.
SCREENCASTS
VIDEO
<details> <summary>EXAMPLES / SCREENSHOTS</summary>
- example-Subs_ImGui
<!--- example-Subs_ofxGui / ofxGui
- example-Subs_ofxGui2 / ofxGui (Video Player)
- example-SubtitleWhisper / Whisper (Real-time audio to text) [ ADVANCED / WIP ]
- example-SubtitleChatGPT / [ ADVANCED / WIP ]
VIDEO
</details>
USAGE
ofApp.h
``.cpp include "ofxSurfingTextSubtitle.h"
ofxSurfingTextSubtitle subs;
ofApp.cpp
.cpp void ofApp::setup() { //subs.setup("Alphaville.srt"); // Optional } void ofApp::draw() { subs.draw();
subs.drawGui(); } `
DEPENDENCIES
OPTIONAL
- ofxGui / Optional (oF core)
- ofxWhisper / FORK (Only for the example)
- ofxChatGPT / FORK (Only for the example)
TODO
- List and load different render fonts files on runtime.
- macOS testing.
TESTED SYSTEM
Windows 10 / VS 2022 / OF ~0.11
THANKS
SRT parser: file srtparser.h. Taken from https://github.com/Jonathhhan/ofEmscriptenExamples. Thanks to @Jonathhhan. Originally by @saurabhshri. ofxPlaybackGui from @roymacdonald bundled into /libs`. Optional to use only when using ofxGui as GUI. (Can be removed when using ofxSurfingImGui.) ofxWhisper from @roymacdonald. Powered by whisper.cpp from @ggerganov. - ofxChatGPT from @tettou771.
LICENSE
MIT LICENSEGet this addon
Latest release
v0.3
published 3y ago
- Added whisper example, using ofxWhisper.
- Added MANUAL mode to print text manually without loading any SRT file.
- Many improvements.
- BUG: removes some words in some situations.
ofxAddons