GameSentenceMiner 2.4.8__tar.gz → 2.4.10__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 (33) hide show
  1. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/config_gui.py +2 -1
  2. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/configuration.py +5 -5
  3. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/ffmpeg.py +8 -2
  4. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner.egg-info/PKG-INFO +4 -131
  5. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/PKG-INFO +4 -131
  6. gamesentenceminer-2.4.10/README.md +85 -0
  7. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/pyproject.toml +1 -1
  8. gamesentenceminer-2.4.8/README.md +0 -212
  9. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/__init__.py +0 -0
  10. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/anki.py +0 -0
  11. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/downloader/Untitled_json.py +0 -0
  12. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/downloader/__init__.py +0 -0
  13. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/downloader/download_tools.py +0 -0
  14. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/electron_messaging.py +0 -0
  15. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/gametext.py +0 -0
  16. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/gsm.py +0 -0
  17. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/model.py +0 -0
  18. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/notification.py +0 -0
  19. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/obs.py +0 -0
  20. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/package.py +0 -0
  21. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/util.py +0 -0
  22. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/utility_gui.py +0 -0
  23. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/vad/__init__.py +0 -0
  24. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/vad/silero_trim.py +0 -0
  25. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/vad/vosk_helper.py +0 -0
  26. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner/vad/whisper_helper.py +0 -0
  27. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner.egg-info/SOURCES.txt +0 -0
  28. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner.egg-info/dependency_links.txt +0 -0
  29. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner.egg-info/entry_points.txt +0 -0
  30. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner.egg-info/requires.txt +0 -0
  31. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/GameSentenceMiner.egg-info/top_level.txt +0 -0
  32. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/LICENSE +0 -0
  33. {gamesentenceminer-2.4.8 → gamesentenceminer-2.4.10}/setup.cfg +0 -0
@@ -888,6 +888,7 @@ class ConfigApp:
888
888
 
889
889
 
890
890
  if __name__ == '__main__':
891
- window = ConfigApp()
891
+ root = ttk.Window(themename='darkly')
892
+ window = ConfigApp(root)
892
893
  window.show()
893
894
  window.window.mainloop()
@@ -123,7 +123,7 @@ class Audio:
123
123
  class OBS:
124
124
  enabled: bool = True
125
125
  open_obs: bool = True
126
- close_obs: bool = False
126
+ close_obs: bool = True
127
127
  host: str = "localhost"
128
128
  port: int = 4455
129
129
  password: str = "your_password"
@@ -356,8 +356,8 @@ def get_config():
356
356
  config = config_instance.get_config()
357
357
 
358
358
  if config.features.backfill_audio and config.features.full_auto:
359
- logger.error("Cannot have backfill_audio and obs_full_auto_mode turned on at the same time!")
360
- exit(1)
359
+ logger.warning("Backfill audio is enabled, but full auto is also enabled. Disabling backfill...")
360
+ config.features.backfill_audio = False
361
361
 
362
362
  # print(config_instance.get_config())
363
363
  return config_instance.get_config()
@@ -369,8 +369,8 @@ def reload_config():
369
369
  config = config_instance.get_config()
370
370
 
371
371
  if config.features.backfill_audio and config.features.full_auto:
372
- print("Cannot have backfill_audio and obs_full_auto_mode turned on at the same time!")
373
- exit(1)
372
+ logger.warning("Backfill is enabled, but full auto is also enabled. Disabling backfill...")
373
+ config.features.backfill_audio = False
374
374
 
375
375
  def get_master_config():
376
376
  return config_instance
@@ -49,7 +49,7 @@ def get_screenshot(video_file, time_from_end):
49
49
  return output_image
50
50
 
51
51
 
52
- def get_screenshot_time(video_path, game_line):
52
+ def get_screenshot_time(video_path, game_line, default_beginning=False):
53
53
  if game_line:
54
54
  line_time = game_line.time
55
55
  else:
@@ -64,7 +64,13 @@ def get_screenshot_time(video_path, game_line):
64
64
  time_from_end = file_length - total_seconds - get_config().screenshot.seconds_after_line
65
65
 
66
66
  if time_from_end < 0 or time_from_end > file_length:
67
- raise ValueError("Calculated screenshot time is out of bounds for trimmed video.")
67
+ logger.error(
68
+ "Calculated screenshot time is out of bounds for trimmed video")
69
+ if default_beginning:
70
+ logger.info("Defaulting to using the beginning of the Replay Buffer")
71
+ return file_length - 1.0
72
+ logger.info("Defaulting to using the end of the Replay Buffer")
73
+ return 0
68
74
 
69
75
  return time_from_end
70
76
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: GameSentenceMiner
3
- Version: 2.4.8
3
+ Version: 2.4.10
4
4
  Summary: A tool for mining sentences from games. Update: Multi-Line Mining! Fixed!
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -64,96 +64,13 @@ There are settings in GSM that may help accomodate for a poor hook, but if you e
64
64
  - **Hotkey Automation**: Single hotkey to trigger video recording, screenshot, and transcription.
65
65
  - **1-Click Card Creation**: Monitors anki for new cards from Yomitan, and automatically gets audio from games.
66
66
 
67
- ## Prerequisites
68
-
69
- - [Python 3.11+](https://www.python.org/downloads/release/python-3119/)
70
- - Important: 3.13 is [NOT supported](https://stackoverflow.com/questions/79175945/keyerror-version-installing-openai-whisper-on-python-3-13).
71
-
72
- ---
73
-
74
- ## 1. Installing and Running the Script
75
-
76
- ### New Way as of 2.4.0
77
-
78
- Grab the latest Installer from [Releases](https://github.com/bpwhelan/GameSentenceMiner/releases).
79
-
80
- ### Old Way - Will still work for the forseeable future
81
-
82
- https://pypi.org/project/GameSentenceMiner/
83
-
84
- Python + pip needs to be installed, make sure you install 3.11 or higher, since older versions may not be supported.
85
-
86
- Install:
87
- ```commandline
88
- pip install gamesentenceminer
89
- ```
90
-
91
- Run:
92
- ```commandline
93
- gamesentenceminer
94
- ```
95
-
96
- 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.
97
-
98
- ---
99
-
100
- ## 2. Setting Up OBS Replay Buffer
101
-
102
- 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.
103
- 2. Set Scene/Source. I recommend using "Game Capture" with "Capture Audio" Enabled. And then mute Desktop/microphone
104
- 1. If "Game Capture" Does not work, use "Window Capture".
105
- 2. I recommend having a Scene PER Game, with the name of the scene labeled as the game, this makes it easier for the
106
- script to know (with a config option) what game you are playing.
107
- 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.
108
-
109
- Here are the Settings I use in OBS. Make sure the recordings folder is the same as the "folder_to_watch" in the config.
110
- ![image](https://github.com/user-attachments/assets/0056816d-af3c-4a3c-bc6a-4aff5c28cadb)
111
- ![image](https://github.com/user-attachments/assets/dd2f95a6-f546-41d9-8136-de7b1b035a5d)
112
-
113
- ---
114
-
115
- ## 3. Configuring the App.
116
-
117
- ### Configuration GUI
118
-
119
- The `GameSentenceMiner` project now includes a graphical interface to simplify configuration. With default values
120
- already set, this GUI lets you adjust settings as needed. Here’s how to get started:
121
-
122
- #### Running the Configuration GUI
123
-
124
- To open the GUI, you have two options:
125
-
126
- 1. **Tray Icon**: Right Click the Tray Icon and Click `Open Settings`
127
-
128
- #### Default Settings and Customization
129
-
130
- The GUI loads with default values for each setting, so if you’re just getting started, you may only need to change options
131
- in the "path" config. If you make changes, remember to click **Save Settings** to apply them.
132
- Please take a second to look through the config to see what is available, there is a lot of extra functionality hidden
133
- behind config options.
134
-
135
- ![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)
136
-
137
-
138
67
  ---
139
68
 
69
+ ## Documentation
140
70
 
141
- ## 4. One Click Card Creation
142
-
143
- This is the flagship feature of this script, so here is a section explaining it. It is possible to do full 1-click card
144
- creation with this tool + Yomitan/JL. The relevant settings are located in `Features` and `OBS` section in the config.
145
-
146
- Demo: https://www.youtube.com/watch?v=9dmmXO2CGNw
147
-
148
- Screenshots to help with setup (THIS IS ALREADY DONE FOR YOU IN NEWER VERSIONS):
71
+ Help with Installation, Setup, and other information can be found in the project's [Wiki](https://github.com/bpwhelan/GameSentenceMiner/wiki).
149
72
 
150
- ![image](https://github.com/user-attachments/assets/7de031e9-ce28-42eb-a8fd-0e60ef70dc3d)
151
-
152
- ![image](https://github.com/user-attachments/assets/b0c70a1a-65b5-4fe7-a7e4-ccb0b9a5b249)
153
-
154
- ![image](https://github.com/user-attachments/assets/4cf492eb-12a2-429f-aa0e-f87fc0fa6270)
155
-
156
- ## 4. Example Process
73
+ ## Example Process
157
74
 
158
75
  1. Start script: `gamesentenceminer`
159
76
  2. Start game
@@ -170,50 +87,6 @@ Once the Anki card is created:
170
87
 
171
88
  ---
172
89
 
173
- ## How to Update the Script
174
-
175
- ### PIP Install (Preferred)
176
-
177
- If you installed the script via pip, you can update it with the following command:
178
- ```bash
179
- pip install --upgrade gamesentenceminer
180
- ```
181
-
182
-
183
- ### Source (For if you want to make edits to the script)
184
-
185
- 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.
186
-
187
- To ensure you always have the latest version of this script, you can use `git pull` to update your local repository with
188
- the latest changes from the remote repository.
189
-
190
- #### Step-by-Step Instructions
191
-
192
- 1. Open your terminal and navigate to the directory where you cloned the repository:
193
- ```bash
194
- cd path/to/script
195
- ```
196
-
197
- 2. Run the following command to fetch and integrate the latest changes:
198
- ```bash
199
- git pull origin main
200
- ```
201
-
202
- - **`origin`** refers to the remote repository from which you cloned the code.
203
- - **`main`** refers to the main branch of the repository. I~~~~f your default branch has a different name (
204
- e.g., `master` or `dev`), replace `main` with that branch name.
205
-
206
- 3. The `git pull` command will download and apply any updates from the remote repository to your local version.
207
-
208
- ### Example:
209
-
210
- ```bash
211
- $ cd path/to/script
212
- $ git pull origin master
213
- ```
214
-
215
- ---
216
-
217
90
  ## Disclaimer/Troubleshooting
218
91
 
219
92
  Every game/hook is different, so it's really impossible that any script can get it perfect every time. Also OBS is
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: GameSentenceMiner
3
- Version: 2.4.8
3
+ Version: 2.4.10
4
4
  Summary: A tool for mining sentences from games. Update: Multi-Line Mining! Fixed!
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -64,96 +64,13 @@ There are settings in GSM that may help accomodate for a poor hook, but if you e
64
64
  - **Hotkey Automation**: Single hotkey to trigger video recording, screenshot, and transcription.
65
65
  - **1-Click Card Creation**: Monitors anki for new cards from Yomitan, and automatically gets audio from games.
66
66
 
67
- ## Prerequisites
68
-
69
- - [Python 3.11+](https://www.python.org/downloads/release/python-3119/)
70
- - Important: 3.13 is [NOT supported](https://stackoverflow.com/questions/79175945/keyerror-version-installing-openai-whisper-on-python-3-13).
71
-
72
- ---
73
-
74
- ## 1. Installing and Running the Script
75
-
76
- ### New Way as of 2.4.0
77
-
78
- Grab the latest Installer from [Releases](https://github.com/bpwhelan/GameSentenceMiner/releases).
79
-
80
- ### Old Way - Will still work for the forseeable future
81
-
82
- https://pypi.org/project/GameSentenceMiner/
83
-
84
- Python + pip needs to be installed, make sure you install 3.11 or higher, since older versions may not be supported.
85
-
86
- Install:
87
- ```commandline
88
- pip install gamesentenceminer
89
- ```
90
-
91
- Run:
92
- ```commandline
93
- gamesentenceminer
94
- ```
95
-
96
- 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.
97
-
98
- ---
99
-
100
- ## 2. Setting Up OBS Replay Buffer
101
-
102
- 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.
103
- 2. Set Scene/Source. I recommend using "Game Capture" with "Capture Audio" Enabled. And then mute Desktop/microphone
104
- 1. If "Game Capture" Does not work, use "Window Capture".
105
- 2. I recommend having a Scene PER Game, with the name of the scene labeled as the game, this makes it easier for the
106
- script to know (with a config option) what game you are playing.
107
- 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.
108
-
109
- Here are the Settings I use in OBS. Make sure the recordings folder is the same as the "folder_to_watch" in the config.
110
- ![image](https://github.com/user-attachments/assets/0056816d-af3c-4a3c-bc6a-4aff5c28cadb)
111
- ![image](https://github.com/user-attachments/assets/dd2f95a6-f546-41d9-8136-de7b1b035a5d)
112
-
113
- ---
114
-
115
- ## 3. Configuring the App.
116
-
117
- ### Configuration GUI
118
-
119
- The `GameSentenceMiner` project now includes a graphical interface to simplify configuration. With default values
120
- already set, this GUI lets you adjust settings as needed. Here’s how to get started:
121
-
122
- #### Running the Configuration GUI
123
-
124
- To open the GUI, you have two options:
125
-
126
- 1. **Tray Icon**: Right Click the Tray Icon and Click `Open Settings`
127
-
128
- #### Default Settings and Customization
129
-
130
- The GUI loads with default values for each setting, so if you’re just getting started, you may only need to change options
131
- in the "path" config. If you make changes, remember to click **Save Settings** to apply them.
132
- Please take a second to look through the config to see what is available, there is a lot of extra functionality hidden
133
- behind config options.
134
-
135
- ![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)
136
-
137
-
138
67
  ---
139
68
 
69
+ ## Documentation
140
70
 
141
- ## 4. One Click Card Creation
142
-
143
- This is the flagship feature of this script, so here is a section explaining it. It is possible to do full 1-click card
144
- creation with this tool + Yomitan/JL. The relevant settings are located in `Features` and `OBS` section in the config.
145
-
146
- Demo: https://www.youtube.com/watch?v=9dmmXO2CGNw
147
-
148
- Screenshots to help with setup (THIS IS ALREADY DONE FOR YOU IN NEWER VERSIONS):
71
+ Help with Installation, Setup, and other information can be found in the project's [Wiki](https://github.com/bpwhelan/GameSentenceMiner/wiki).
149
72
 
150
- ![image](https://github.com/user-attachments/assets/7de031e9-ce28-42eb-a8fd-0e60ef70dc3d)
151
-
152
- ![image](https://github.com/user-attachments/assets/b0c70a1a-65b5-4fe7-a7e4-ccb0b9a5b249)
153
-
154
- ![image](https://github.com/user-attachments/assets/4cf492eb-12a2-429f-aa0e-f87fc0fa6270)
155
-
156
- ## 4. Example Process
73
+ ## Example Process
157
74
 
158
75
  1. Start script: `gamesentenceminer`
159
76
  2. Start game
@@ -170,50 +87,6 @@ Once the Anki card is created:
170
87
 
171
88
  ---
172
89
 
173
- ## How to Update the Script
174
-
175
- ### PIP Install (Preferred)
176
-
177
- If you installed the script via pip, you can update it with the following command:
178
- ```bash
179
- pip install --upgrade gamesentenceminer
180
- ```
181
-
182
-
183
- ### Source (For if you want to make edits to the script)
184
-
185
- 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.
186
-
187
- To ensure you always have the latest version of this script, you can use `git pull` to update your local repository with
188
- the latest changes from the remote repository.
189
-
190
- #### Step-by-Step Instructions
191
-
192
- 1. Open your terminal and navigate to the directory where you cloned the repository:
193
- ```bash
194
- cd path/to/script
195
- ```
196
-
197
- 2. Run the following command to fetch and integrate the latest changes:
198
- ```bash
199
- git pull origin main
200
- ```
201
-
202
- - **`origin`** refers to the remote repository from which you cloned the code.
203
- - **`main`** refers to the main branch of the repository. I~~~~f your default branch has a different name (
204
- e.g., `master` or `dev`), replace `main` with that branch name.
205
-
206
- 3. The `git pull` command will download and apply any updates from the remote repository to your local version.
207
-
208
- ### Example:
209
-
210
- ```bash
211
- $ cd path/to/script
212
- $ git pull origin master
213
- ```
214
-
215
- ---
216
-
217
90
  ## Disclaimer/Troubleshooting
218
91
 
219
92
  Every game/hook is different, so it's really impossible that any script can get it perfect every time. Also OBS is
@@ -0,0 +1,85 @@
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=FeFBL7py6HY
9
+
10
+ Installation: https://youtu.be/h5ksXallc-o
11
+
12
+ ## How Does it Work?
13
+
14
+ This is the #1 question I get, and knowing this helps clear up a lot of misunderstanding on issues you may encounter while using GSM.
15
+
16
+ 1. The beginning of the voiceline is marked by a text event. Usually this comes in the form of an event from textractor/agent, or any other texthooking engine. GSM handles both listening for clipboard copy, as well as on a websocket server (configurable in GSM).
17
+ 2. The end of the voiceline is found using a Voice Activation Detection (VAD) library running on your local machine. ([Example](https://github.com/snakers4/silero-vad))
18
+
19
+ That's it.
20
+
21
+ There are settings in GSM that may help accomodate for a poor hook, but if you encounter wild inconsistencies in your audio, it's likely due to a poorly timed hook, very loud BGM, or some other external factor, not GSM. I have not touched the audio trimming logic for months and it's been excellent for many many people across many games.
22
+
23
+ ## Features:
24
+
25
+ - **OBS Replay Buffer**: Constantly records the last X seconds of gameplay.
26
+ - **Voice Activity Detection**: Automatically cuts the end of the clip to the exact moment the voice ended.
27
+ - **Clipboard Interaction**: Automatically monitors the clipboard for dialogue events.
28
+ - **Websocket Listening**: Listens to a websocket uri for text-events from stuff like Agent/Textractor.
29
+ - **Hotkey Automation**: Single hotkey to trigger video recording, screenshot, and transcription.
30
+ - **1-Click Card Creation**: Monitors anki for new cards from Yomitan, and automatically gets audio from games.
31
+
32
+ ---
33
+
34
+ ## Documentation
35
+
36
+ Help with Installation, Setup, and other information can be found in the project's [Wiki](https://github.com/bpwhelan/GameSentenceMiner/wiki).
37
+
38
+ ## Example Process
39
+
40
+ 1. Start script: `gamesentenceminer`
41
+ 2. Start game
42
+ 3. Hook Game with Agent (or textractor) with clipboard enabled
43
+ 4. Create Anki Card with target word (through a texthooker page/Yomitan)
44
+ 5. When finished gaming, End script (not required)
45
+
46
+ Once the Anki card is created:
47
+
48
+ 1. **OBS** will save the last X seconds of gameplay.
49
+ 2. The Python script will trim the audio based on last clipboard event, and the end of voice line detected in VAD if
50
+ enabled.
51
+ 3. Will attempt to update the LAST anki card created.
52
+
53
+ ---
54
+
55
+ ## Disclaimer/Troubleshooting
56
+
57
+ Every game/hook is different, so it's really impossible that any script can get it perfect every time. Also OBS is
58
+ sometimes a bit finicky if running for too long. If the audio timing is off, please first try some troubleshooting
59
+ steps before making an issue:
60
+
61
+ - Try Restarting OBS
62
+ - Make sure your hook is the best you can find. (Preferably it gives you the text RIGHT when the voice line starts)
63
+ - Try Adjusting Offset Configuration in `config.toml` to better match your situation. (i.e. if the hook is late, add a
64
+ negative beginning offset)
65
+ - Try using "Trim beginning" in `VAD` settings.
66
+
67
+ ### Setup Troubleshooting
68
+
69
+ Just going to continuously update this with issues that I have helped users with. Look here first if you have issues
70
+ setting it up.
71
+
72
+ - Make sure folder_to_watch is the same as your recordings path in OBS. It defaults to ~/Videos, but I recommend setting
73
+ it to ~/Videos/GSM.
74
+ - If using clipboard, make sure Agent/Textractor sending to clipboard is enabled.
75
+ - 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.
76
+
77
+
78
+ ## Contact
79
+
80
+ If you run into issues ask in my [Discord](https://discord.gg/yP8Qse6bb8), or make an issue here.
81
+
82
+ ## Donations
83
+
84
+ If you've benefited from this or any of my other projects, please consider supporting my work
85
+ via [Github Sponsors](https://github.com/sponsors/bpwhelan) or [Ko-fi.](https://ko-fi.com/beangate)
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "GameSentenceMiner"
10
- version = "2.4.8"
10
+ version = "2.4.10"
11
11
  description = "A tool for mining sentences from games. Update: Multi-Line Mining! Fixed!"
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.10"
@@ -1,212 +0,0 @@
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=FeFBL7py6HY
9
-
10
- Installation: https://youtu.be/h5ksXallc-o
11
-
12
- ## How Does it Work?
13
-
14
- This is the #1 question I get, and knowing this helps clear up a lot of misunderstanding on issues you may encounter while using GSM.
15
-
16
- 1. The beginning of the voiceline is marked by a text event. Usually this comes in the form of an event from textractor/agent, or any other texthooking engine. GSM handles both listening for clipboard copy, as well as on a websocket server (configurable in GSM).
17
- 2. The end of the voiceline is found using a Voice Activation Detection (VAD) library running on your local machine. ([Example](https://github.com/snakers4/silero-vad))
18
-
19
- That's it.
20
-
21
- There are settings in GSM that may help accomodate for a poor hook, but if you encounter wild inconsistencies in your audio, it's likely due to a poorly timed hook, very loud BGM, or some other external factor, not GSM. I have not touched the audio trimming logic for months and it's been excellent for many many people across many games.
22
-
23
- ## Features:
24
-
25
- - **OBS Replay Buffer**: Constantly records the last X seconds of gameplay.
26
- - **Voice Activity Detection**: Automatically cuts the end of the clip to the exact moment the voice ended.
27
- - **Clipboard Interaction**: Automatically monitors the clipboard for dialogue events.
28
- - **Websocket Listening**: Listens to a websocket uri for text-events from stuff like Agent/Textractor.
29
- - **Hotkey Automation**: Single hotkey to trigger video recording, screenshot, and transcription.
30
- - **1-Click Card Creation**: Monitors anki for new cards from Yomitan, and automatically gets audio from games.
31
-
32
- ## Prerequisites
33
-
34
- - [Python 3.11+](https://www.python.org/downloads/release/python-3119/)
35
- - Important: 3.13 is [NOT supported](https://stackoverflow.com/questions/79175945/keyerror-version-installing-openai-whisper-on-python-3-13).
36
-
37
- ---
38
-
39
- ## 1. Installing and Running the Script
40
-
41
- ### New Way as of 2.4.0
42
-
43
- Grab the latest Installer from [Releases](https://github.com/bpwhelan/GameSentenceMiner/releases).
44
-
45
- ### Old Way - Will still work for the forseeable future
46
-
47
- https://pypi.org/project/GameSentenceMiner/
48
-
49
- Python + pip needs to be installed, make sure you install 3.11 or higher, since older versions may not be supported.
50
-
51
- Install:
52
- ```commandline
53
- pip install gamesentenceminer
54
- ```
55
-
56
- Run:
57
- ```commandline
58
- gamesentenceminer
59
- ```
60
-
61
- 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.
62
-
63
- ---
64
-
65
- ## 2. Setting Up OBS Replay Buffer
66
-
67
- 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.
68
- 2. Set Scene/Source. I recommend using "Game Capture" with "Capture Audio" Enabled. And then mute Desktop/microphone
69
- 1. If "Game Capture" Does not work, use "Window Capture".
70
- 2. I recommend having a Scene PER Game, with the name of the scene labeled as the game, this makes it easier for the
71
- script to know (with a config option) what game you are playing.
72
- 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.
73
-
74
- Here are the Settings I use in OBS. Make sure the recordings folder is the same as the "folder_to_watch" in the config.
75
- ![image](https://github.com/user-attachments/assets/0056816d-af3c-4a3c-bc6a-4aff5c28cadb)
76
- ![image](https://github.com/user-attachments/assets/dd2f95a6-f546-41d9-8136-de7b1b035a5d)
77
-
78
- ---
79
-
80
- ## 3. Configuring the App.
81
-
82
- ### Configuration GUI
83
-
84
- The `GameSentenceMiner` project now includes a graphical interface to simplify configuration. With default values
85
- already set, this GUI lets you adjust settings as needed. Here’s how to get started:
86
-
87
- #### Running the Configuration GUI
88
-
89
- To open the GUI, you have two options:
90
-
91
- 1. **Tray Icon**: Right Click the Tray Icon and Click `Open Settings`
92
-
93
- #### Default Settings and Customization
94
-
95
- The GUI loads with default values for each setting, so if you’re just getting started, you may only need to change options
96
- in the "path" config. If you make changes, remember to click **Save Settings** to apply them.
97
- Please take a second to look through the config to see what is available, there is a lot of extra functionality hidden
98
- behind config options.
99
-
100
- ![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)
101
-
102
-
103
- ---
104
-
105
-
106
- ## 4. One Click Card Creation
107
-
108
- This is the flagship feature of this script, so here is a section explaining it. It is possible to do full 1-click card
109
- creation with this tool + Yomitan/JL. The relevant settings are located in `Features` and `OBS` section in the config.
110
-
111
- Demo: https://www.youtube.com/watch?v=9dmmXO2CGNw
112
-
113
- Screenshots to help with setup (THIS IS ALREADY DONE FOR YOU IN NEWER VERSIONS):
114
-
115
- ![image](https://github.com/user-attachments/assets/7de031e9-ce28-42eb-a8fd-0e60ef70dc3d)
116
-
117
- ![image](https://github.com/user-attachments/assets/b0c70a1a-65b5-4fe7-a7e4-ccb0b9a5b249)
118
-
119
- ![image](https://github.com/user-attachments/assets/4cf492eb-12a2-429f-aa0e-f87fc0fa6270)
120
-
121
- ## 4. Example Process
122
-
123
- 1. Start script: `gamesentenceminer`
124
- 2. Start game
125
- 3. Hook Game with Agent (or textractor) with clipboard enabled
126
- 4. Create Anki Card with target word (through a texthooker page/Yomitan)
127
- 5. When finished gaming, End script (not required)
128
-
129
- Once the Anki card is created:
130
-
131
- 1. **OBS** will save the last X seconds of gameplay.
132
- 2. The Python script will trim the audio based on last clipboard event, and the end of voice line detected in VAD if
133
- enabled.
134
- 3. Will attempt to update the LAST anki card created.
135
-
136
- ---
137
-
138
- ## How to Update the Script
139
-
140
- ### PIP Install (Preferred)
141
-
142
- If you installed the script via pip, you can update it with the following command:
143
- ```bash
144
- pip install --upgrade gamesentenceminer
145
- ```
146
-
147
-
148
- ### Source (For if you want to make edits to the script)
149
-
150
- 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.
151
-
152
- To ensure you always have the latest version of this script, you can use `git pull` to update your local repository with
153
- the latest changes from the remote repository.
154
-
155
- #### Step-by-Step Instructions
156
-
157
- 1. Open your terminal and navigate to the directory where you cloned the repository:
158
- ```bash
159
- cd path/to/script
160
- ```
161
-
162
- 2. Run the following command to fetch and integrate the latest changes:
163
- ```bash
164
- git pull origin main
165
- ```
166
-
167
- - **`origin`** refers to the remote repository from which you cloned the code.
168
- - **`main`** refers to the main branch of the repository. I~~~~f your default branch has a different name (
169
- e.g., `master` or `dev`), replace `main` with that branch name.
170
-
171
- 3. The `git pull` command will download and apply any updates from the remote repository to your local version.
172
-
173
- ### Example:
174
-
175
- ```bash
176
- $ cd path/to/script
177
- $ git pull origin master
178
- ```
179
-
180
- ---
181
-
182
- ## Disclaimer/Troubleshooting
183
-
184
- Every game/hook is different, so it's really impossible that any script can get it perfect every time. Also OBS is
185
- sometimes a bit finicky if running for too long. If the audio timing is off, please first try some troubleshooting
186
- steps before making an issue:
187
-
188
- - Try Restarting OBS
189
- - Make sure your hook is the best you can find. (Preferably it gives you the text RIGHT when the voice line starts)
190
- - Try Adjusting Offset Configuration in `config.toml` to better match your situation. (i.e. if the hook is late, add a
191
- negative beginning offset)
192
- - Try using "Trim beginning" in `VAD` settings.
193
-
194
- ### Setup Troubleshooting
195
-
196
- Just going to continuously update this with issues that I have helped users with. Look here first if you have issues
197
- setting it up.
198
-
199
- - Make sure folder_to_watch is the same as your recordings path in OBS. It defaults to ~/Videos, but I recommend setting
200
- it to ~/Videos/GSM.
201
- - If using clipboard, make sure Agent/Textractor sending to clipboard is enabled.
202
- - 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.
203
-
204
-
205
- ## Contact
206
-
207
- If you run into issues ask in my [Discord](https://discord.gg/yP8Qse6bb8), or make an issue here.
208
-
209
- ## Donations
210
-
211
- If you've benefited from this or any of my other projects, please consider supporting my work
212
- via [Github Sponsors](https://github.com/sponsors/bpwhelan) or [Ko-fi.](https://ko-fi.com/beangate)