GameSentenceMiner 2.2.0__tar.gz → 2.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. gamesentenceminer-2.2.1/GameSentenceMiner.egg-info/PKG-INFO +229 -0
  2. gamesentenceminer-2.2.1/PKG-INFO +229 -0
  3. gamesentenceminer-2.2.1/README.md +195 -0
  4. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/pyproject.toml +2 -2
  5. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/anki.py +7 -7
  6. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/configuration.py +2 -4
  7. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/ffmpeg.py +6 -2
  8. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/gametext.py +2 -2
  9. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/gsm.py +5 -6
  10. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/notification.py +5 -3
  11. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/obs.py +10 -11
  12. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/util.py +8 -6
  13. gamesentenceminer-2.2.0/GameSentenceMiner.egg-info/PKG-INFO +0 -348
  14. gamesentenceminer-2.2.0/PKG-INFO +0 -348
  15. gamesentenceminer-2.2.0/README.md +0 -314
  16. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/GameSentenceMiner.egg-info/SOURCES.txt +0 -0
  17. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/GameSentenceMiner.egg-info/dependency_links.txt +0 -0
  18. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/GameSentenceMiner.egg-info/entry_points.txt +0 -0
  19. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/GameSentenceMiner.egg-info/requires.txt +0 -0
  20. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/GameSentenceMiner.egg-info/top_level.txt +0 -0
  21. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/setup.cfg +0 -0
  22. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/__init__.py +0 -0
  23. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/config_gui.py +0 -0
  24. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/downloader/Untitled_json.py +0 -0
  25. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/downloader/__init__.py +0 -0
  26. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/downloader/download_tools.py +0 -0
  27. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/model.py +0 -0
  28. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/package_updater.py +0 -0
  29. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/vad/__init__.py +0 -0
  30. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/vad/silero_trim.py +0 -0
  31. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/vad/vosk_helper.py +0 -0
  32. {gamesentenceminer-2.2.0 → gamesentenceminer-2.2.1}/src/vad/whisper_helper.py +0 -0
@@ -0,0 +1,229 @@
1
+ Metadata-Version: 2.2
2
+ Name: GameSentenceMiner
3
+ Version: 2.2.1
4
+ Summary: A tool for mining sentences from games. Update: Use ffprobe from GSM Directory
5
+ Author-email: Beangate <bpwhelan95@gmail.com>
6
+ License: MIT License
7
+ Project-URL: Homepage, https://github.com/bpwhelan/GameSentenceMiner
8
+ Project-URL: Repository, https://github.com/bpwhelan/GameSentenceMiner
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.11
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: requests~=2.32.3
15
+ Requires-Dist: watchdog~=5.0.2
16
+ Requires-Dist: DateTime~=5.5
17
+ Requires-Dist: pyperclip~=1.9.0
18
+ Requires-Dist: vosk~=0.3.45
19
+ Requires-Dist: soundfile~=0.12.1
20
+ Requires-Dist: toml~=0.10.2
21
+ Requires-Dist: psutil~=6.0.0
22
+ Requires-Dist: rapidfuzz~=3.9.7
23
+ Requires-Dist: obs-websocket-py~=1.0
24
+ Requires-Dist: plyer~=2.1.0
25
+ Requires-Dist: keyboard~=0.13.5
26
+ Requires-Dist: websockets~=13.0.1
27
+ Requires-Dist: stable-ts~=2.17.5
28
+ Requires-Dist: silero-vad~=5.1.2
29
+ Requires-Dist: ttkbootstrap~=1.10.1
30
+ Requires-Dist: dataclasses_json~=0.6.7
31
+ Requires-Dist: numpy
32
+ Requires-Dist: pystray
33
+ Requires-Dist: pywin32
34
+
35
+ # Game Sentence Miner
36
+
37
+ This project automates the recording of game sentence audio to help with Anki Card Creation.
38
+
39
+ This allows us to create cards from texthooker/yomitan, and automatically get screenshot and sentence audio from the
40
+ game we are playing.
41
+
42
+ Short Demo (Watch this first): https://www.youtube.com/watch?v=J2At52oWieU
43
+
44
+ Installation: https://www.youtube.com/watch?v=b-L4g9tA508
45
+
46
+ ## Features:
47
+
48
+ - **OBS Replay Buffer**: Constantly records the last X seconds of gameplay.
49
+ - **Voice Activity Detection**: Automatically cuts the end of the clip to the exact moment the voice ended.
50
+ - **Clipboard Interaction**: Automatically monitors the clipboard for dialogue events.
51
+ - **Websocket Listening**: Listens to a websocket uri for text-events from stuff like Agent/Textractor.
52
+ - **Hotkey Automation**: Single hotkey to trigger video recording, screenshot, and transcription.
53
+ - **1-Click Card Creation**: Monitors anki for new cards from Yomitan, and automatically gets audio from games.
54
+
55
+ ## Prerequisites
56
+
57
+ - [Python 3.11+](https://www.python.org/downloads/release/python-3119/)
58
+ - Important: 3.13 is [NOT supported](https://stackoverflow.com/questions/79175945/keyerror-version-installing-openai-whisper-on-python-3-13).
59
+
60
+ ---
61
+
62
+ ## 1. Installing and Running the Script
63
+
64
+ https://pypi.org/project/GameSentenceMiner/
65
+
66
+ Python + pip needs to be installed, make sure you install 3.11 or higher, since older versions may not be supported.
67
+
68
+ Install:
69
+ ```commandline
70
+ pip install gamesentenceminer
71
+ ```
72
+
73
+ Run:
74
+ ```commandline
75
+ gamesentenceminer
76
+ ```
77
+
78
+ On first run, this will download OBS and FFMPEG, and do some basic configuration. You will need to edit the GSM config for your specific Anki fields and whatnot.
79
+
80
+ ---
81
+
82
+ ## 2. Setting Up OBS Replay Buffer
83
+
84
+ 1. Go to Settings > Output > Replay Buffer, and make sure OBS Replay Buffer is enabled, I recommend setting it to 60 seconds, but shorter and longer buffers should also work.
85
+ 2. Set Scene/Source. I recommend using "Game Capture" with "Capture Audio" Enabled. And then mute Desktop/microphone
86
+ 1. If "Game Capture" Does not work, use "Window Capture".
87
+ 2. I recommend having a Scene PER Game, with the name of the scene labeled as the game, this makes it easier for the
88
+ script to know (with a config option) what game you are playing.
89
+ 3. In Output Settings, set "Recording Format" to mkv, and "Audio Encoder" to Opus. Alternate Audio Encoder settings are supported, but will be re-encoded to Opus by default.
90
+
91
+ Here are the Settings I use in OBS. Make sure the recordings folder is the same as the "folder_to_watch" in the config.
92
+ ![image](https://github.com/user-attachments/assets/0056816d-af3c-4a3c-bc6a-4aff5c28cadb)
93
+ ![image](https://github.com/user-attachments/assets/dd2f95a6-f546-41d9-8136-de7b1b035a5d)
94
+
95
+ ---
96
+
97
+ ## 3. Configuring the App.
98
+
99
+ ### Configuration GUI
100
+
101
+ The `GameSentenceMiner` project now includes a graphical interface to simplify configuration. With default values
102
+ already set, this GUI lets you adjust settings as needed. Here’s how to get started:
103
+
104
+ #### Running the Configuration GUI
105
+
106
+ To open the GUI, you have two options:
107
+
108
+ 1. **Tray Icon**: Right Click the Tray Icon and Click `Open Settings`
109
+
110
+ #### Default Settings and Customization
111
+
112
+ The GUI loads with default values for each setting, so if you’re just getting started, you may only need to change options
113
+ in the "path" config. If you make changes, remember to click **Save Settings** to apply them.
114
+ Please take a second to look through the config to see what is available, there is a lot of extra functionality hidden
115
+ behind config options.
116
+
117
+ ![image](https://github.com/user-attachments/assets/ffac9888-de0a-412b-817f-e22a55ce7b55)![image](https://github.com/user-attachments/assets/981c112a-1ddc-4e07-9c39-57fe46644ff5)![image](https://github.com/user-attachments/assets/29470a97-6013-4ca8-9059-48af735eb3a8)![image](https://github.com/user-attachments/assets/8e9c8f03-dc43-4822-a3c5-43f36ca65364)
118
+
119
+
120
+ ---
121
+
122
+
123
+ ## 4. One Click Card Creation
124
+
125
+ This is the flagship feature of this script, so here is a section explaining it. It is possible to do full 1-click card
126
+ creation with this tool + Yomitan/JL. The relevant settings are located in `Features` and `OBS` section in the config.
127
+
128
+ Demo: https://www.youtube.com/watch?v=9dmmXO2CGNw
129
+
130
+ Screenshots to help with setup (THIS IS ALREADY DONE FOR YOU IN NEWER VERSIONS):
131
+
132
+ ![image](https://github.com/user-attachments/assets/7de031e9-ce28-42eb-a8fd-0e60ef70dc3d)
133
+
134
+ ![image](https://github.com/user-attachments/assets/b0c70a1a-65b5-4fe7-a7e4-ccb0b9a5b249)
135
+
136
+ ![image](https://github.com/user-attachments/assets/4cf492eb-12a2-429f-aa0e-f87fc0fa6270)
137
+
138
+ ## 4. Example Process
139
+
140
+ 1. Start script: `gamesentenceminer`
141
+ 2. Start game
142
+ 3. Hook Game with Agent (or textractor) with clipboard enabled
143
+ 4. Create Anki Card with target word (through a texthooker page/Yomitan)
144
+ 5. When finished gaming, End script (not required)
145
+
146
+ Once the Anki card is created:
147
+
148
+ 1. **OBS** will save the last X seconds of gameplay.
149
+ 2. The Python script will trim the audio based on last clipboard event, and the end of voice line detected in VAD if
150
+ enabled.
151
+ 3. Will attempt to update the LAST anki card created.
152
+
153
+ ---
154
+
155
+ ## How to Update the Script
156
+
157
+ ### PIP Install (Preferred)
158
+
159
+ If you installed the script via pip, you can update it with the following command:
160
+ ```bash
161
+ pip install --upgrade gamesentenceminer
162
+ ```
163
+
164
+
165
+ ### Source (For if you want to make edits to the script)
166
+
167
+ I will probably remove this section at a later date. If you want to make edits to the script, you should know how to do this.
168
+
169
+ To ensure you always have the latest version of this script, you can use `git pull` to update your local repository with
170
+ the latest changes from the remote repository.
171
+
172
+ #### Step-by-Step Instructions
173
+
174
+ 1. Open your terminal and navigate to the directory where you cloned the repository:
175
+ ```bash
176
+ cd path/to/script
177
+ ```
178
+
179
+ 2. Run the following command to fetch and integrate the latest changes:
180
+ ```bash
181
+ git pull origin main
182
+ ```
183
+
184
+ - **`origin`** refers to the remote repository from which you cloned the code.
185
+ - **`main`** refers to the main branch of the repository. I~~~~f your default branch has a different name (
186
+ e.g., `master` or `dev`), replace `main` with that branch name.
187
+
188
+ 3. The `git pull` command will download and apply any updates from the remote repository to your local version.
189
+
190
+ ### Example:
191
+
192
+ ```bash
193
+ $ cd path/to/script
194
+ $ git pull origin master
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Disclaimer/Troubleshooting
200
+
201
+ Every game/hook is different, so it's really impossible that any script can get it perfect every time. Also OBS is
202
+ sometimes a bit finicky if running for too long. If the audio timing is off, please first try some troubleshooting
203
+ steps before making an issue:
204
+
205
+ - Try Restarting OBS
206
+ - Make sure your hook is the best you can find. (Preferably it gives you the text RIGHT when the voice line starts)
207
+ - Try Adjusting Offset Configuration in `config.toml` to better match your situation. (i.e. if the hook is late, add a
208
+ negative beginning offset)
209
+ - Try using "Trim beginning" in `VAD` settings.
210
+
211
+ ### Setup Troubleshooting
212
+
213
+ Just going to continuously update this with issues that I have helped users with. Look here first if you have issues
214
+ setting it up.
215
+
216
+ - Make sure folder_to_watch is the same as your recordings path in OBS. It defaults to ~/Videos, but I recommend setting
217
+ it to ~/Videos/GSM.
218
+ - If using clipboard, make sure Agent/Textractor sending to clipboard is enabled.
219
+ - If using websocket, make sure the websocket server is running and the uri is correct in both GSM AND agent/textractor. Textractor uses a default of 6677, and I would recommend changing Agent to use 6677 as well.
220
+
221
+
222
+ ## Contact
223
+
224
+ If you run into issues ask in my [Discord](https://discord.gg/yP8Qse6bb8), or make an issue here.
225
+
226
+ ## Donations
227
+
228
+ If you've benefited from this or any of my other projects, please consider supporting my work
229
+ via [Github Sponsors](https://github.com/sponsors/bpwhelan) or [Ko-fi.](https://ko-fi.com/beangate)
@@ -0,0 +1,229 @@
1
+ Metadata-Version: 2.2
2
+ Name: GameSentenceMiner
3
+ Version: 2.2.1
4
+ Summary: A tool for mining sentences from games. Update: Use ffprobe from GSM Directory
5
+ Author-email: Beangate <bpwhelan95@gmail.com>
6
+ License: MIT License
7
+ Project-URL: Homepage, https://github.com/bpwhelan/GameSentenceMiner
8
+ Project-URL: Repository, https://github.com/bpwhelan/GameSentenceMiner
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.11
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: requests~=2.32.3
15
+ Requires-Dist: watchdog~=5.0.2
16
+ Requires-Dist: DateTime~=5.5
17
+ Requires-Dist: pyperclip~=1.9.0
18
+ Requires-Dist: vosk~=0.3.45
19
+ Requires-Dist: soundfile~=0.12.1
20
+ Requires-Dist: toml~=0.10.2
21
+ Requires-Dist: psutil~=6.0.0
22
+ Requires-Dist: rapidfuzz~=3.9.7
23
+ Requires-Dist: obs-websocket-py~=1.0
24
+ Requires-Dist: plyer~=2.1.0
25
+ Requires-Dist: keyboard~=0.13.5
26
+ Requires-Dist: websockets~=13.0.1
27
+ Requires-Dist: stable-ts~=2.17.5
28
+ Requires-Dist: silero-vad~=5.1.2
29
+ Requires-Dist: ttkbootstrap~=1.10.1
30
+ Requires-Dist: dataclasses_json~=0.6.7
31
+ Requires-Dist: numpy
32
+ Requires-Dist: pystray
33
+ Requires-Dist: pywin32
34
+
35
+ # Game Sentence Miner
36
+
37
+ This project automates the recording of game sentence audio to help with Anki Card Creation.
38
+
39
+ This allows us to create cards from texthooker/yomitan, and automatically get screenshot and sentence audio from the
40
+ game we are playing.
41
+
42
+ Short Demo (Watch this first): https://www.youtube.com/watch?v=J2At52oWieU
43
+
44
+ Installation: https://www.youtube.com/watch?v=b-L4g9tA508
45
+
46
+ ## Features:
47
+
48
+ - **OBS Replay Buffer**: Constantly records the last X seconds of gameplay.
49
+ - **Voice Activity Detection**: Automatically cuts the end of the clip to the exact moment the voice ended.
50
+ - **Clipboard Interaction**: Automatically monitors the clipboard for dialogue events.
51
+ - **Websocket Listening**: Listens to a websocket uri for text-events from stuff like Agent/Textractor.
52
+ - **Hotkey Automation**: Single hotkey to trigger video recording, screenshot, and transcription.
53
+ - **1-Click Card Creation**: Monitors anki for new cards from Yomitan, and automatically gets audio from games.
54
+
55
+ ## Prerequisites
56
+
57
+ - [Python 3.11+](https://www.python.org/downloads/release/python-3119/)
58
+ - Important: 3.13 is [NOT supported](https://stackoverflow.com/questions/79175945/keyerror-version-installing-openai-whisper-on-python-3-13).
59
+
60
+ ---
61
+
62
+ ## 1. Installing and Running the Script
63
+
64
+ https://pypi.org/project/GameSentenceMiner/
65
+
66
+ Python + pip needs to be installed, make sure you install 3.11 or higher, since older versions may not be supported.
67
+
68
+ Install:
69
+ ```commandline
70
+ pip install gamesentenceminer
71
+ ```
72
+
73
+ Run:
74
+ ```commandline
75
+ gamesentenceminer
76
+ ```
77
+
78
+ On first run, this will download OBS and FFMPEG, and do some basic configuration. You will need to edit the GSM config for your specific Anki fields and whatnot.
79
+
80
+ ---
81
+
82
+ ## 2. Setting Up OBS Replay Buffer
83
+
84
+ 1. Go to Settings > Output > Replay Buffer, and make sure OBS Replay Buffer is enabled, I recommend setting it to 60 seconds, but shorter and longer buffers should also work.
85
+ 2. Set Scene/Source. I recommend using "Game Capture" with "Capture Audio" Enabled. And then mute Desktop/microphone
86
+ 1. If "Game Capture" Does not work, use "Window Capture".
87
+ 2. I recommend having a Scene PER Game, with the name of the scene labeled as the game, this makes it easier for the
88
+ script to know (with a config option) what game you are playing.
89
+ 3. In Output Settings, set "Recording Format" to mkv, and "Audio Encoder" to Opus. Alternate Audio Encoder settings are supported, but will be re-encoded to Opus by default.
90
+
91
+ Here are the Settings I use in OBS. Make sure the recordings folder is the same as the "folder_to_watch" in the config.
92
+ ![image](https://github.com/user-attachments/assets/0056816d-af3c-4a3c-bc6a-4aff5c28cadb)
93
+ ![image](https://github.com/user-attachments/assets/dd2f95a6-f546-41d9-8136-de7b1b035a5d)
94
+
95
+ ---
96
+
97
+ ## 3. Configuring the App.
98
+
99
+ ### Configuration GUI
100
+
101
+ The `GameSentenceMiner` project now includes a graphical interface to simplify configuration. With default values
102
+ already set, this GUI lets you adjust settings as needed. Here’s how to get started:
103
+
104
+ #### Running the Configuration GUI
105
+
106
+ To open the GUI, you have two options:
107
+
108
+ 1. **Tray Icon**: Right Click the Tray Icon and Click `Open Settings`
109
+
110
+ #### Default Settings and Customization
111
+
112
+ The GUI loads with default values for each setting, so if you’re just getting started, you may only need to change options
113
+ in the "path" config. If you make changes, remember to click **Save Settings** to apply them.
114
+ Please take a second to look through the config to see what is available, there is a lot of extra functionality hidden
115
+ behind config options.
116
+
117
+ ![image](https://github.com/user-attachments/assets/ffac9888-de0a-412b-817f-e22a55ce7b55)![image](https://github.com/user-attachments/assets/981c112a-1ddc-4e07-9c39-57fe46644ff5)![image](https://github.com/user-attachments/assets/29470a97-6013-4ca8-9059-48af735eb3a8)![image](https://github.com/user-attachments/assets/8e9c8f03-dc43-4822-a3c5-43f36ca65364)
118
+
119
+
120
+ ---
121
+
122
+
123
+ ## 4. One Click Card Creation
124
+
125
+ This is the flagship feature of this script, so here is a section explaining it. It is possible to do full 1-click card
126
+ creation with this tool + Yomitan/JL. The relevant settings are located in `Features` and `OBS` section in the config.
127
+
128
+ Demo: https://www.youtube.com/watch?v=9dmmXO2CGNw
129
+
130
+ Screenshots to help with setup (THIS IS ALREADY DONE FOR YOU IN NEWER VERSIONS):
131
+
132
+ ![image](https://github.com/user-attachments/assets/7de031e9-ce28-42eb-a8fd-0e60ef70dc3d)
133
+
134
+ ![image](https://github.com/user-attachments/assets/b0c70a1a-65b5-4fe7-a7e4-ccb0b9a5b249)
135
+
136
+ ![image](https://github.com/user-attachments/assets/4cf492eb-12a2-429f-aa0e-f87fc0fa6270)
137
+
138
+ ## 4. Example Process
139
+
140
+ 1. Start script: `gamesentenceminer`
141
+ 2. Start game
142
+ 3. Hook Game with Agent (or textractor) with clipboard enabled
143
+ 4. Create Anki Card with target word (through a texthooker page/Yomitan)
144
+ 5. When finished gaming, End script (not required)
145
+
146
+ Once the Anki card is created:
147
+
148
+ 1. **OBS** will save the last X seconds of gameplay.
149
+ 2. The Python script will trim the audio based on last clipboard event, and the end of voice line detected in VAD if
150
+ enabled.
151
+ 3. Will attempt to update the LAST anki card created.
152
+
153
+ ---
154
+
155
+ ## How to Update the Script
156
+
157
+ ### PIP Install (Preferred)
158
+
159
+ If you installed the script via pip, you can update it with the following command:
160
+ ```bash
161
+ pip install --upgrade gamesentenceminer
162
+ ```
163
+
164
+
165
+ ### Source (For if you want to make edits to the script)
166
+
167
+ I will probably remove this section at a later date. If you want to make edits to the script, you should know how to do this.
168
+
169
+ To ensure you always have the latest version of this script, you can use `git pull` to update your local repository with
170
+ the latest changes from the remote repository.
171
+
172
+ #### Step-by-Step Instructions
173
+
174
+ 1. Open your terminal and navigate to the directory where you cloned the repository:
175
+ ```bash
176
+ cd path/to/script
177
+ ```
178
+
179
+ 2. Run the following command to fetch and integrate the latest changes:
180
+ ```bash
181
+ git pull origin main
182
+ ```
183
+
184
+ - **`origin`** refers to the remote repository from which you cloned the code.
185
+ - **`main`** refers to the main branch of the repository. I~~~~f your default branch has a different name (
186
+ e.g., `master` or `dev`), replace `main` with that branch name.
187
+
188
+ 3. The `git pull` command will download and apply any updates from the remote repository to your local version.
189
+
190
+ ### Example:
191
+
192
+ ```bash
193
+ $ cd path/to/script
194
+ $ git pull origin master
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Disclaimer/Troubleshooting
200
+
201
+ Every game/hook is different, so it's really impossible that any script can get it perfect every time. Also OBS is
202
+ sometimes a bit finicky if running for too long. If the audio timing is off, please first try some troubleshooting
203
+ steps before making an issue:
204
+
205
+ - Try Restarting OBS
206
+ - Make sure your hook is the best you can find. (Preferably it gives you the text RIGHT when the voice line starts)
207
+ - Try Adjusting Offset Configuration in `config.toml` to better match your situation. (i.e. if the hook is late, add a
208
+ negative beginning offset)
209
+ - Try using "Trim beginning" in `VAD` settings.
210
+
211
+ ### Setup Troubleshooting
212
+
213
+ Just going to continuously update this with issues that I have helped users with. Look here first if you have issues
214
+ setting it up.
215
+
216
+ - Make sure folder_to_watch is the same as your recordings path in OBS. It defaults to ~/Videos, but I recommend setting
217
+ it to ~/Videos/GSM.
218
+ - If using clipboard, make sure Agent/Textractor sending to clipboard is enabled.
219
+ - If using websocket, make sure the websocket server is running and the uri is correct in both GSM AND agent/textractor. Textractor uses a default of 6677, and I would recommend changing Agent to use 6677 as well.
220
+
221
+
222
+ ## Contact
223
+
224
+ If you run into issues ask in my [Discord](https://discord.gg/yP8Qse6bb8), or make an issue here.
225
+
226
+ ## Donations
227
+
228
+ If you've benefited from this or any of my other projects, please consider supporting my work
229
+ via [Github Sponsors](https://github.com/sponsors/bpwhelan) or [Ko-fi.](https://ko-fi.com/beangate)
@@ -0,0 +1,195 @@
1
+ # Game Sentence Miner
2
+
3
+ This project automates the recording of game sentence audio to help with Anki Card Creation.
4
+
5
+ This allows us to create cards from texthooker/yomitan, and automatically get screenshot and sentence audio from the
6
+ game we are playing.
7
+
8
+ Short Demo (Watch this first): https://www.youtube.com/watch?v=J2At52oWieU
9
+
10
+ Installation: https://www.youtube.com/watch?v=b-L4g9tA508
11
+
12
+ ## Features:
13
+
14
+ - **OBS Replay Buffer**: Constantly records the last X seconds of gameplay.
15
+ - **Voice Activity Detection**: Automatically cuts the end of the clip to the exact moment the voice ended.
16
+ - **Clipboard Interaction**: Automatically monitors the clipboard for dialogue events.
17
+ - **Websocket Listening**: Listens to a websocket uri for text-events from stuff like Agent/Textractor.
18
+ - **Hotkey Automation**: Single hotkey to trigger video recording, screenshot, and transcription.
19
+ - **1-Click Card Creation**: Monitors anki for new cards from Yomitan, and automatically gets audio from games.
20
+
21
+ ## Prerequisites
22
+
23
+ - [Python 3.11+](https://www.python.org/downloads/release/python-3119/)
24
+ - Important: 3.13 is [NOT supported](https://stackoverflow.com/questions/79175945/keyerror-version-installing-openai-whisper-on-python-3-13).
25
+
26
+ ---
27
+
28
+ ## 1. Installing and Running the Script
29
+
30
+ https://pypi.org/project/GameSentenceMiner/
31
+
32
+ Python + pip needs to be installed, make sure you install 3.11 or higher, since older versions may not be supported.
33
+
34
+ Install:
35
+ ```commandline
36
+ pip install gamesentenceminer
37
+ ```
38
+
39
+ Run:
40
+ ```commandline
41
+ gamesentenceminer
42
+ ```
43
+
44
+ On first run, this will download OBS and FFMPEG, and do some basic configuration. You will need to edit the GSM config for your specific Anki fields and whatnot.
45
+
46
+ ---
47
+
48
+ ## 2. Setting Up OBS Replay Buffer
49
+
50
+ 1. Go to Settings > Output > Replay Buffer, and make sure OBS Replay Buffer is enabled, I recommend setting it to 60 seconds, but shorter and longer buffers should also work.
51
+ 2. Set Scene/Source. I recommend using "Game Capture" with "Capture Audio" Enabled. And then mute Desktop/microphone
52
+ 1. If "Game Capture" Does not work, use "Window Capture".
53
+ 2. I recommend having a Scene PER Game, with the name of the scene labeled as the game, this makes it easier for the
54
+ script to know (with a config option) what game you are playing.
55
+ 3. In Output Settings, set "Recording Format" to mkv, and "Audio Encoder" to Opus. Alternate Audio Encoder settings are supported, but will be re-encoded to Opus by default.
56
+
57
+ Here are the Settings I use in OBS. Make sure the recordings folder is the same as the "folder_to_watch" in the config.
58
+ ![image](https://github.com/user-attachments/assets/0056816d-af3c-4a3c-bc6a-4aff5c28cadb)
59
+ ![image](https://github.com/user-attachments/assets/dd2f95a6-f546-41d9-8136-de7b1b035a5d)
60
+
61
+ ---
62
+
63
+ ## 3. Configuring the App.
64
+
65
+ ### Configuration GUI
66
+
67
+ The `GameSentenceMiner` project now includes a graphical interface to simplify configuration. With default values
68
+ already set, this GUI lets you adjust settings as needed. Here’s how to get started:
69
+
70
+ #### Running the Configuration GUI
71
+
72
+ To open the GUI, you have two options:
73
+
74
+ 1. **Tray Icon**: Right Click the Tray Icon and Click `Open Settings`
75
+
76
+ #### Default Settings and Customization
77
+
78
+ The GUI loads with default values for each setting, so if you’re just getting started, you may only need to change options
79
+ in the "path" config. If you make changes, remember to click **Save Settings** to apply them.
80
+ Please take a second to look through the config to see what is available, there is a lot of extra functionality hidden
81
+ behind config options.
82
+
83
+ ![image](https://github.com/user-attachments/assets/ffac9888-de0a-412b-817f-e22a55ce7b55)![image](https://github.com/user-attachments/assets/981c112a-1ddc-4e07-9c39-57fe46644ff5)![image](https://github.com/user-attachments/assets/29470a97-6013-4ca8-9059-48af735eb3a8)![image](https://github.com/user-attachments/assets/8e9c8f03-dc43-4822-a3c5-43f36ca65364)
84
+
85
+
86
+ ---
87
+
88
+
89
+ ## 4. One Click Card Creation
90
+
91
+ This is the flagship feature of this script, so here is a section explaining it. It is possible to do full 1-click card
92
+ creation with this tool + Yomitan/JL. The relevant settings are located in `Features` and `OBS` section in the config.
93
+
94
+ Demo: https://www.youtube.com/watch?v=9dmmXO2CGNw
95
+
96
+ Screenshots to help with setup (THIS IS ALREADY DONE FOR YOU IN NEWER VERSIONS):
97
+
98
+ ![image](https://github.com/user-attachments/assets/7de031e9-ce28-42eb-a8fd-0e60ef70dc3d)
99
+
100
+ ![image](https://github.com/user-attachments/assets/b0c70a1a-65b5-4fe7-a7e4-ccb0b9a5b249)
101
+
102
+ ![image](https://github.com/user-attachments/assets/4cf492eb-12a2-429f-aa0e-f87fc0fa6270)
103
+
104
+ ## 4. Example Process
105
+
106
+ 1. Start script: `gamesentenceminer`
107
+ 2. Start game
108
+ 3. Hook Game with Agent (or textractor) with clipboard enabled
109
+ 4. Create Anki Card with target word (through a texthooker page/Yomitan)
110
+ 5. When finished gaming, End script (not required)
111
+
112
+ Once the Anki card is created:
113
+
114
+ 1. **OBS** will save the last X seconds of gameplay.
115
+ 2. The Python script will trim the audio based on last clipboard event, and the end of voice line detected in VAD if
116
+ enabled.
117
+ 3. Will attempt to update the LAST anki card created.
118
+
119
+ ---
120
+
121
+ ## How to Update the Script
122
+
123
+ ### PIP Install (Preferred)
124
+
125
+ If you installed the script via pip, you can update it with the following command:
126
+ ```bash
127
+ pip install --upgrade gamesentenceminer
128
+ ```
129
+
130
+
131
+ ### Source (For if you want to make edits to the script)
132
+
133
+ I will probably remove this section at a later date. If you want to make edits to the script, you should know how to do this.
134
+
135
+ To ensure you always have the latest version of this script, you can use `git pull` to update your local repository with
136
+ the latest changes from the remote repository.
137
+
138
+ #### Step-by-Step Instructions
139
+
140
+ 1. Open your terminal and navigate to the directory where you cloned the repository:
141
+ ```bash
142
+ cd path/to/script
143
+ ```
144
+
145
+ 2. Run the following command to fetch and integrate the latest changes:
146
+ ```bash
147
+ git pull origin main
148
+ ```
149
+
150
+ - **`origin`** refers to the remote repository from which you cloned the code.
151
+ - **`main`** refers to the main branch of the repository. I~~~~f your default branch has a different name (
152
+ e.g., `master` or `dev`), replace `main` with that branch name.
153
+
154
+ 3. The `git pull` command will download and apply any updates from the remote repository to your local version.
155
+
156
+ ### Example:
157
+
158
+ ```bash
159
+ $ cd path/to/script
160
+ $ git pull origin master
161
+ ```
162
+
163
+ ---
164
+
165
+ ## Disclaimer/Troubleshooting
166
+
167
+ Every game/hook is different, so it's really impossible that any script can get it perfect every time. Also OBS is
168
+ sometimes a bit finicky if running for too long. If the audio timing is off, please first try some troubleshooting
169
+ steps before making an issue:
170
+
171
+ - Try Restarting OBS
172
+ - Make sure your hook is the best you can find. (Preferably it gives you the text RIGHT when the voice line starts)
173
+ - Try Adjusting Offset Configuration in `config.toml` to better match your situation. (i.e. if the hook is late, add a
174
+ negative beginning offset)
175
+ - Try using "Trim beginning" in `VAD` settings.
176
+
177
+ ### Setup Troubleshooting
178
+
179
+ Just going to continuously update this with issues that I have helped users with. Look here first if you have issues
180
+ setting it up.
181
+
182
+ - Make sure folder_to_watch is the same as your recordings path in OBS. It defaults to ~/Videos, but I recommend setting
183
+ it to ~/Videos/GSM.
184
+ - If using clipboard, make sure Agent/Textractor sending to clipboard is enabled.
185
+ - If using websocket, make sure the websocket server is running and the uri is correct in both GSM AND agent/textractor. Textractor uses a default of 6677, and I would recommend changing Agent to use 6677 as well.
186
+
187
+
188
+ ## Contact
189
+
190
+ If you run into issues ask in my [Discord](https://discord.gg/yP8Qse6bb8), or make an issue here.
191
+
192
+ ## Donations
193
+
194
+ If you've benefited from this or any of my other projects, please consider supporting my work
195
+ via [Github Sponsors](https://github.com/sponsors/bpwhelan) or [Ko-fi.](https://ko-fi.com/beangate)
@@ -7,8 +7,8 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "GameSentenceMiner"
10
- version = "2.2.0"
11
- description = "A tool for mining sentences from games."
10
+ version = "2.2.1"
11
+ description = "A tool for mining sentences from games. Update: Use ffprobe from GSM Directory"
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.11"
14
14
  license = { text = "MIT License" }