https://github.com/glnsh/text-to-subtitle
SubText: Text to Subtitles converts TXT to SRT written in C
https://github.com/glnsh/text-to-subtitle
c subtitles
Last synced: about 1 month ago
JSON representation
SubText: Text to Subtitles converts TXT to SRT written in C
- Host: GitHub
- URL: https://github.com/glnsh/text-to-subtitle
- Owner: GLNsH
- Created: 2025-01-13T12:00:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-11T11:30:41.000Z (over 1 year ago)
- Last Synced: 2025-03-04T06:14:24.209Z (over 1 year ago)
- Topics: c, subtitles
- Language: C
- Homepage:
- Size: 83 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: docs/README.md
Awesome Lists containing this project
README
# Text to Subtitle: TXT to SRT file
The purpose of this small program is to solve a simple problem, that is ***"how do I convert a transcript file to subtitles conveniently?".***
Nah, not really. I wanted to convert ***transcript text to timed subtitles**, so that I can feed the **subtitles to a text-to-speech** program which in turn creates a **voice over for free**.
## Features
- Custom configuration of subtitle timings through ```config.ini```
- Length of subtile per line can be changed
## Using SubText
I appologize, I only know gcc to build all of my codes as of wrtiting this readme.
- Build ```main.c``` and ```config.c``` in the ```src``` folder using ```gcc```
```ps
gcc src\main.c src\config.c -Wall -W -O -o main
```
- Run the ```main``` application, this will create initialize the ```config.ini``` and ```read.txt```.
- In ```read.txt``` paste the text you want to convert to subtitles.
- Then, run the ```main``` application again, this will produce ```subtitles.srt``` which you can now use.
## Configuration ```config.ini```
Each configuration has default values, if it is ommited in the ```config.ini``` file.
- ```[FILES]``` section specifies the directory of the read and write files
- ```READ_FILE_DIR``` defaults to ```"read.txt"```
- ```WRITE_FILE_DIR``` defaults to ```"write.srt"```
- ```[SUBTITLE_TIMINGS]``` section specifies the spacing and padding time per line of subtitle
- ```[TIMINGS]``` section specifies the timing per type it found.
- ```[BUFFER_SIZES]``` section specifies the spacing and padding time per line of subtitle
- ```LINE_BUFFER_SIZE``` specifies the maximum lenght of one subtitle line, defaults to ```500```
- ```WORD_BUFFER_SIZE``` specifies the maximum word that it can read from the read file, defaults to ```100```
- ```PUNCT_BUFFER_SIZE``` specifies the maximum symbol that it can read from the read file, defaults to ```10```