GameSentenceMiner 2.8.22__tar.gz → 2.8.24__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 (67) hide show
  1. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/obs.py +21 -7
  2. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/ocr/owocr_area_selector.py +3 -1
  3. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/owocr/owocr/run.py +1 -10
  4. gamesentenceminer-2.8.24/GameSentenceMiner.egg-info/PKG-INFO +156 -0
  5. gamesentenceminer-2.8.24/PKG-INFO +156 -0
  6. gamesentenceminer-2.8.24/README.md +115 -0
  7. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/pyproject.toml +1 -1
  8. gamesentenceminer-2.8.22/GameSentenceMiner.egg-info/PKG-INFO +0 -132
  9. gamesentenceminer-2.8.22/PKG-INFO +0 -132
  10. gamesentenceminer-2.8.22/README.md +0 -91
  11. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/__init__.py +0 -0
  12. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/ai/__init__.py +0 -0
  13. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/ai/ai_prompting.py +0 -0
  14. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/anki.py +0 -0
  15. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/communication/__init__.py +0 -0
  16. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/communication/send.py +0 -0
  17. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/communication/websocket.py +0 -0
  18. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/config_gui.py +0 -0
  19. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/configuration.py +0 -0
  20. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/downloader/Untitled_json.py +0 -0
  21. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/downloader/__init__.py +0 -0
  22. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/downloader/download_tools.py +0 -0
  23. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/downloader/oneocr_dl.py +0 -0
  24. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/electron_config.py +0 -0
  25. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/ffmpeg.py +0 -0
  26. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/gametext.py +0 -0
  27. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/gsm.py +0 -0
  28. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/model.py +0 -0
  29. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/notification.py +0 -0
  30. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/ocr/__init__.py +0 -0
  31. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/ocr/gsm_ocr_config.py +0 -0
  32. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/ocr/ocrconfig.py +0 -0
  33. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/ocr/owocr_helper.py +0 -0
  34. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/owocr/owocr/__init__.py +0 -0
  35. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/owocr/owocr/__main__.py +0 -0
  36. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/owocr/owocr/config.py +0 -0
  37. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/owocr/owocr/lens_betterproto.py +0 -0
  38. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/owocr/owocr/ocr.py +0 -0
  39. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/owocr/owocr/screen_coordinate_picker.py +0 -0
  40. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/package.py +0 -0
  41. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/text_log.py +0 -0
  42. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/util.py +0 -0
  43. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/vad/__init__.py +0 -0
  44. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/vad/silero_trim.py +0 -0
  45. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/vad/vosk_helper.py +0 -0
  46. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/vad/whisper_helper.py +0 -0
  47. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/__init__.py +0 -0
  48. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/static/__init__.py +0 -0
  49. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/static/apple-touch-icon.png +0 -0
  50. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/static/favicon-96x96.png +0 -0
  51. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/static/favicon.ico +0 -0
  52. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/static/favicon.svg +0 -0
  53. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/static/site.webmanifest +0 -0
  54. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/static/style.css +0 -0
  55. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/static/web-app-manifest-192x192.png +0 -0
  56. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/static/web-app-manifest-512x512.png +0 -0
  57. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/templates/__init__.py +0 -0
  58. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/templates/text_replacements.html +0 -0
  59. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/templates/utility.html +0 -0
  60. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner/web/texthooking_page.py +0 -0
  61. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner.egg-info/SOURCES.txt +0 -0
  62. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner.egg-info/dependency_links.txt +0 -0
  63. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner.egg-info/entry_points.txt +0 -0
  64. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner.egg-info/requires.txt +0 -0
  65. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/GameSentenceMiner.egg-info/top_level.txt +0 -0
  66. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/LICENSE +0 -0
  67. {gamesentenceminer-2.8.22 → gamesentenceminer-2.8.24}/setup.cfg +0 -0
@@ -117,16 +117,30 @@ def on_disconnect(obs):
117
117
  connected = False
118
118
 
119
119
 
120
- def connect_to_obs():
120
+ def connect_to_obs(retry_count=0):
121
121
  global client
122
- if get_config().obs.enabled and not client:
123
- if util.is_windows():
124
- get_obs_websocket_config_values()
125
- client = obsws(host=get_config().obs.host, port=get_config().obs.port,
126
- password=get_config().obs.password, authreconnect=1, on_connect=on_connect,
127
- on_disconnect=on_disconnect)
122
+ if not get_config().obs.enabled or client:
123
+ return
124
+
125
+ if util.is_windows():
126
+ get_obs_websocket_config_values()
127
+
128
+ try:
129
+ client = obsws(
130
+ host=get_config().obs.host,
131
+ port=get_config().obs.port,
132
+ password=get_config().obs.password,
133
+ authreconnect=1,
134
+ on_connect=on_connect,
135
+ on_disconnect=on_disconnect
136
+ )
128
137
  client.connect()
129
138
  update_current_game()
139
+ except Exception as e:
140
+ if retry_count % 5 == 0:
141
+ logger.error(f"Failed to connect to OBS WebSocket: {e}. Retrying...")
142
+ time.sleep(1)
143
+ connect_to_obs(retry_count=retry_count + 1)
130
144
 
131
145
 
132
146
  # Disconnect from OBS WebSocket
@@ -716,6 +716,7 @@ class ScreenSelector:
716
716
  canvas.bind('<Control-s>', self.save_rects) # Save
717
717
  canvas.bind('<Control-z>', self.undo_last_rect) # Undo
718
718
  canvas.bind('<Control-y>', self.redo_last_rect) # Redo
719
+ canvas.bind("<m>", toggle_image_mode) # Toggle image mode (alpha)
719
720
 
720
721
 
721
722
  # --- Bind Global Actions to the window (apply to all windows) ---
@@ -724,11 +725,12 @@ class ScreenSelector:
724
725
  window.bind('<Control-s>', self.save_rects) # Save
725
726
  window.bind('<Control-z>', self.undo_last_rect) # Undo
726
727
  window.bind('<Control-y>', self.redo_last_rect) # Redo
727
- # Optional: Add non-Ctrl versions if desired
728
+ # # Optional: Add non-Ctrl versions if desired
728
729
  window.bind('<s>', self.save_rects)
729
730
  window.bind('<z>', self.undo_last_rect)
730
731
  window.bind('<y>', self.redo_last_rect)
731
732
  window.bind("<Escape>", self.quit_app) # Quit
733
+ window.bind('<Button-3>', on_right_click) # Right click delete
732
734
  window.bind("<m>", toggle_image_mode) # Toggle image mode (alpha)
733
735
 
734
736
  def start(self):
@@ -1,24 +1,15 @@
1
- from datetime import datetime
2
- import sys
3
- import signal
4
- import time
5
1
  import threading
6
- from pathlib import Path
7
2
 
8
- import fire
9
- import numpy as np
10
3
  import pyperclipfix
11
4
  import mss
12
5
  import asyncio
13
6
  import websockets
14
7
  import socketserver
15
8
  import queue
16
- import io
17
- import re
18
9
 
10
+ from datetime import datetime
19
11
  from PIL import Image, ImageDraw
20
12
  from PIL import UnidentifiedImageError
21
- from loguru import logger
22
13
  from pynput import keyboard
23
14
  from desktop_notifier import DesktopNotifierSync
24
15
  import psutil
@@ -0,0 +1,156 @@
1
+ Metadata-Version: 2.4
2
+ Name: GameSentenceMiner
3
+ Version: 2.8.24
4
+ Summary: A tool for mining sentences from games. Update: Multi-Line Mining! Fixed!
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.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: requests~=2.32.3
16
+ Requires-Dist: watchdog~=5.0.2
17
+ Requires-Dist: DateTime~=5.5
18
+ Requires-Dist: pyperclip~=1.9.0
19
+ Requires-Dist: vosk~=0.3.45
20
+ Requires-Dist: soundfile~=0.12.1
21
+ Requires-Dist: toml~=0.10.2
22
+ Requires-Dist: psutil~=6.0.0
23
+ Requires-Dist: rapidfuzz~=3.9.7
24
+ Requires-Dist: obs-websocket-py~=1.0
25
+ Requires-Dist: plyer~=2.1.0
26
+ Requires-Dist: keyboard~=0.13.5
27
+ Requires-Dist: websockets~=15.0.1
28
+ Requires-Dist: stable-ts~=2.17.5
29
+ Requires-Dist: silero-vad~=5.1.2
30
+ Requires-Dist: ttkbootstrap~=1.10.1
31
+ Requires-Dist: dataclasses_json~=0.6.7
32
+ Requires-Dist: win10toast
33
+ Requires-Dist: numpy
34
+ Requires-Dist: pystray
35
+ Requires-Dist: pywin32; sys_platform == "win32"
36
+ Requires-Dist: google-generativeai
37
+ Requires-Dist: pygetwindow; sys_platform == "win32"
38
+ Requires-Dist: flask
39
+ Requires-Dist: groq
40
+ Dynamic: license-file
41
+
42
+ # GameSentenceMiner (GSM)
43
+
44
+ An application designed to assist with language learning through games. Aiming to be the "[asbplayer](https://github.com/killergerbah/asbplayer)" for games.
45
+
46
+ Short Demo (Watch this first): https://www.youtube.com/watch?v=FeFBL7py6HY
47
+
48
+ Installation: https://youtu.be/h5ksXallc-o
49
+
50
+ Discord: https://discord.gg/yP8Qse6bb8
51
+
52
+ ## Features
53
+
54
+ ### Anki Card Enhancement
55
+
56
+ GSM significantly enhances your Anki cards with rich contextual information:
57
+
58
+ * **Automated Audio Capture**: Automatically records the voice line associated with the text.
59
+
60
+ * **Automatic Trim**: Some simple math around the time that the text event came in, in combination with a "Voice Activation Detection" (VAD) library gives us neatly cut audio.
61
+ * **Manual Trim**: If Automatic voiceline trim is not perfect, it's possible to [open the audio in an external program](https://youtu.be/LKFQFy2Qm64) for trimming.
62
+
63
+ * **Screenshot**: Captures a screenshot of the game at the moment the voice line is spoken.
64
+
65
+ * **Multi-Line**: It's possible to capture multiple lines at once with sentence audio with GSM's very own Texthooker.
66
+
67
+ * **AI Translation**: Integrates AI to provide quick translations of the captured sentence. Custom Prompts also supported. (Optional, Bring your own Key)
68
+
69
+
70
+ #### Game Example
71
+ ![anki_RozcrisS8B](https://github.com/user-attachments/assets/b1f08150-6b46-4d7d-ad90-e6c468076b05)
72
+
73
+ Audio: https://github.com/user-attachments/assets/94360986-8dbf-42c9-b3c3-d054893eac3d
74
+
75
+ ---
76
+
77
+ #### VN Example
78
+ ![anki_Lk3Ds2T1Bz](https://github.com/user-attachments/assets/e8ae4d66-f138-4ae1-9df7-46e16249be41)
79
+
80
+ Audio: https://github.com/user-attachments/assets/2d7b3967-cd5c-4132-b489-75058ea20921
81
+
82
+
83
+ ### OCR
84
+
85
+ GSM integrates with [OwOCR](https://github.com/AuroraWright/owocr/) to provide accurate text capture from games that do not have a hook. Here are some improvements GSM makes on stock OwOCR:
86
+
87
+ * **Easier Setup**: With GSM's managed Python install, setup is only a matter of clicking a few buttons.
88
+
89
+ * **Exclusion Zones**: Instead of choosing an area to OCR, you can choose an area to exclude from OCR. Useful if you have a static interface in your game and text appears randomly throughout.
90
+
91
+ * **Two-Pass OCR**: To cut down on API calls and keep output clean, GSM features a "Two-Pass" OCR System. A Local OCR will be constantly running, and when the text on screen stabilizes, it will run a second, more accurate scan that gets sent to clipboard/WebSocket.
92
+
93
+ * **Consistent Audio Timing**: With the two-pass system, we can still get accurate audio recorded and into Anki without the use of crazy offsets or hacks.
94
+
95
+ * **More Language Support**: Stock OwOCR is hard-coded to Japanese, while in GSM you can use a variety of languages.
96
+
97
+
98
+ ![GameSentenceMiner_efBTEpbZ2A](https://github.com/user-attachments/assets/4b873f9e-c049-428c-9bfd-20907e095054)
99
+ ![anki_f3PdqYLN2n](https://github.com/user-attachments/assets/a901221c-6f7c-471b-a1f3-f29e8ced102c)
100
+
101
+ Audio: https://github.com/user-attachments/assets/8c44780a-9b74-41af-bf16-28a742f4de12
102
+
103
+
104
+ ### Game Launcher Capabilities (WIP)
105
+
106
+ This is probably the feature I care least about, but if you are lazy like me, you may find this helpful.
107
+
108
+ * **Launch**: GSM can launch your games directly, simplifying the setup process.
109
+
110
+ * **Hook**: Streamlines the process of hooking your games (Agent).
111
+
112
+ This feature simplifies the process of launching games and (potentially) hooking them, making the entire workflow more efficient.
113
+
114
+ ![image](https://github.com/user-attachments/assets/eb630535-d291-4386-a5af-9f54b718896a)
115
+
116
+ ## Basic Requirements
117
+
118
+ * **Anki card creation tool**: [Yomitan](https://github.com/yomidevs/yomitan), [JL](https://github.com/rampaa/JL), etc.
119
+
120
+ * **A method of getting text from the game**: [Agent](https://github.com/0xDC00/agent), [Textractor](https://github.com/Artikash/Textractor), [LunaTranslator](https://github.com/HIllya51/LunaTranslator), GSM's OCR, etc.
121
+
122
+ * **A game :)**
123
+
124
+ ## Documentation
125
+
126
+ For help with installation, setup, and other information, please visit the project's [Wiki](https://github.com/bpwhelan/GameSentenceMiner/wiki).
127
+
128
+ ## FAQ
129
+
130
+ ### How Does It Work?
131
+
132
+ This is a common question, and understanding this process will help clarify any issues you might encounter while using GSM.
133
+
134
+ 1. The beginning of the voice line is marked by a text event. This usually comes from Textractor, Agent, or another texthooker. GSM can listen for a clipboard copy and/or a WebSocket server (configurable in GSM).
135
+
136
+ 2. The end of the voice line is detected using a Voice Activity Detection (VAD) library running locally. ([Example](https://github.com/snakers4/silero-vad))
137
+
138
+ In essence, GSM relies on accurately timed text events to capture the corresponding audio.
139
+
140
+ GSM provides settings to accommodate less-than-ideal hooks. However, if you experience significant audio inconsistencies, they likely stem from a poorly timed hook, loud background music, or other external factors, rather than GSM itself. The core audio trimming logic has been stable and effective for many users across various games.
141
+
142
+ ## Contact
143
+
144
+ If you encounter issues, please ask for help in my [Discord](https://discord.gg/yP8Qse6bb8) or create an issue here.
145
+
146
+ ## Acknowledgements
147
+
148
+ * [OwOCR](https://github.com/AuroraWright/owocr) for their outstanding OCR implementation, which I've integrated into GSM.
149
+
150
+ * [chaiNNer](https://github.com/chaiNNer-org/chaiNNer) for the idea of installing Python within an Electron app.
151
+
152
+ * [OBS](https://obsproject.com/) and [FFMPEG](https://ffmpeg.org/), without which GSM would not be possible.
153
+
154
+ ## Donations
155
+
156
+ If you've found this or any of my other projects helpful, please consider supporting my work through [GitHub Sponsors](https://github.com/sponsors/bpwhelan) or [Ko-fi](https://ko-fi.com/beangate).
@@ -0,0 +1,156 @@
1
+ Metadata-Version: 2.4
2
+ Name: GameSentenceMiner
3
+ Version: 2.8.24
4
+ Summary: A tool for mining sentences from games. Update: Multi-Line Mining! Fixed!
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.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: requests~=2.32.3
16
+ Requires-Dist: watchdog~=5.0.2
17
+ Requires-Dist: DateTime~=5.5
18
+ Requires-Dist: pyperclip~=1.9.0
19
+ Requires-Dist: vosk~=0.3.45
20
+ Requires-Dist: soundfile~=0.12.1
21
+ Requires-Dist: toml~=0.10.2
22
+ Requires-Dist: psutil~=6.0.0
23
+ Requires-Dist: rapidfuzz~=3.9.7
24
+ Requires-Dist: obs-websocket-py~=1.0
25
+ Requires-Dist: plyer~=2.1.0
26
+ Requires-Dist: keyboard~=0.13.5
27
+ Requires-Dist: websockets~=15.0.1
28
+ Requires-Dist: stable-ts~=2.17.5
29
+ Requires-Dist: silero-vad~=5.1.2
30
+ Requires-Dist: ttkbootstrap~=1.10.1
31
+ Requires-Dist: dataclasses_json~=0.6.7
32
+ Requires-Dist: win10toast
33
+ Requires-Dist: numpy
34
+ Requires-Dist: pystray
35
+ Requires-Dist: pywin32; sys_platform == "win32"
36
+ Requires-Dist: google-generativeai
37
+ Requires-Dist: pygetwindow; sys_platform == "win32"
38
+ Requires-Dist: flask
39
+ Requires-Dist: groq
40
+ Dynamic: license-file
41
+
42
+ # GameSentenceMiner (GSM)
43
+
44
+ An application designed to assist with language learning through games. Aiming to be the "[asbplayer](https://github.com/killergerbah/asbplayer)" for games.
45
+
46
+ Short Demo (Watch this first): https://www.youtube.com/watch?v=FeFBL7py6HY
47
+
48
+ Installation: https://youtu.be/h5ksXallc-o
49
+
50
+ Discord: https://discord.gg/yP8Qse6bb8
51
+
52
+ ## Features
53
+
54
+ ### Anki Card Enhancement
55
+
56
+ GSM significantly enhances your Anki cards with rich contextual information:
57
+
58
+ * **Automated Audio Capture**: Automatically records the voice line associated with the text.
59
+
60
+ * **Automatic Trim**: Some simple math around the time that the text event came in, in combination with a "Voice Activation Detection" (VAD) library gives us neatly cut audio.
61
+ * **Manual Trim**: If Automatic voiceline trim is not perfect, it's possible to [open the audio in an external program](https://youtu.be/LKFQFy2Qm64) for trimming.
62
+
63
+ * **Screenshot**: Captures a screenshot of the game at the moment the voice line is spoken.
64
+
65
+ * **Multi-Line**: It's possible to capture multiple lines at once with sentence audio with GSM's very own Texthooker.
66
+
67
+ * **AI Translation**: Integrates AI to provide quick translations of the captured sentence. Custom Prompts also supported. (Optional, Bring your own Key)
68
+
69
+
70
+ #### Game Example
71
+ ![anki_RozcrisS8B](https://github.com/user-attachments/assets/b1f08150-6b46-4d7d-ad90-e6c468076b05)
72
+
73
+ Audio: https://github.com/user-attachments/assets/94360986-8dbf-42c9-b3c3-d054893eac3d
74
+
75
+ ---
76
+
77
+ #### VN Example
78
+ ![anki_Lk3Ds2T1Bz](https://github.com/user-attachments/assets/e8ae4d66-f138-4ae1-9df7-46e16249be41)
79
+
80
+ Audio: https://github.com/user-attachments/assets/2d7b3967-cd5c-4132-b489-75058ea20921
81
+
82
+
83
+ ### OCR
84
+
85
+ GSM integrates with [OwOCR](https://github.com/AuroraWright/owocr/) to provide accurate text capture from games that do not have a hook. Here are some improvements GSM makes on stock OwOCR:
86
+
87
+ * **Easier Setup**: With GSM's managed Python install, setup is only a matter of clicking a few buttons.
88
+
89
+ * **Exclusion Zones**: Instead of choosing an area to OCR, you can choose an area to exclude from OCR. Useful if you have a static interface in your game and text appears randomly throughout.
90
+
91
+ * **Two-Pass OCR**: To cut down on API calls and keep output clean, GSM features a "Two-Pass" OCR System. A Local OCR will be constantly running, and when the text on screen stabilizes, it will run a second, more accurate scan that gets sent to clipboard/WebSocket.
92
+
93
+ * **Consistent Audio Timing**: With the two-pass system, we can still get accurate audio recorded and into Anki without the use of crazy offsets or hacks.
94
+
95
+ * **More Language Support**: Stock OwOCR is hard-coded to Japanese, while in GSM you can use a variety of languages.
96
+
97
+
98
+ ![GameSentenceMiner_efBTEpbZ2A](https://github.com/user-attachments/assets/4b873f9e-c049-428c-9bfd-20907e095054)
99
+ ![anki_f3PdqYLN2n](https://github.com/user-attachments/assets/a901221c-6f7c-471b-a1f3-f29e8ced102c)
100
+
101
+ Audio: https://github.com/user-attachments/assets/8c44780a-9b74-41af-bf16-28a742f4de12
102
+
103
+
104
+ ### Game Launcher Capabilities (WIP)
105
+
106
+ This is probably the feature I care least about, but if you are lazy like me, you may find this helpful.
107
+
108
+ * **Launch**: GSM can launch your games directly, simplifying the setup process.
109
+
110
+ * **Hook**: Streamlines the process of hooking your games (Agent).
111
+
112
+ This feature simplifies the process of launching games and (potentially) hooking them, making the entire workflow more efficient.
113
+
114
+ ![image](https://github.com/user-attachments/assets/eb630535-d291-4386-a5af-9f54b718896a)
115
+
116
+ ## Basic Requirements
117
+
118
+ * **Anki card creation tool**: [Yomitan](https://github.com/yomidevs/yomitan), [JL](https://github.com/rampaa/JL), etc.
119
+
120
+ * **A method of getting text from the game**: [Agent](https://github.com/0xDC00/agent), [Textractor](https://github.com/Artikash/Textractor), [LunaTranslator](https://github.com/HIllya51/LunaTranslator), GSM's OCR, etc.
121
+
122
+ * **A game :)**
123
+
124
+ ## Documentation
125
+
126
+ For help with installation, setup, and other information, please visit the project's [Wiki](https://github.com/bpwhelan/GameSentenceMiner/wiki).
127
+
128
+ ## FAQ
129
+
130
+ ### How Does It Work?
131
+
132
+ This is a common question, and understanding this process will help clarify any issues you might encounter while using GSM.
133
+
134
+ 1. The beginning of the voice line is marked by a text event. This usually comes from Textractor, Agent, or another texthooker. GSM can listen for a clipboard copy and/or a WebSocket server (configurable in GSM).
135
+
136
+ 2. The end of the voice line is detected using a Voice Activity Detection (VAD) library running locally. ([Example](https://github.com/snakers4/silero-vad))
137
+
138
+ In essence, GSM relies on accurately timed text events to capture the corresponding audio.
139
+
140
+ GSM provides settings to accommodate less-than-ideal hooks. However, if you experience significant audio inconsistencies, they likely stem from a poorly timed hook, loud background music, or other external factors, rather than GSM itself. The core audio trimming logic has been stable and effective for many users across various games.
141
+
142
+ ## Contact
143
+
144
+ If you encounter issues, please ask for help in my [Discord](https://discord.gg/yP8Qse6bb8) or create an issue here.
145
+
146
+ ## Acknowledgements
147
+
148
+ * [OwOCR](https://github.com/AuroraWright/owocr) for their outstanding OCR implementation, which I've integrated into GSM.
149
+
150
+ * [chaiNNer](https://github.com/chaiNNer-org/chaiNNer) for the idea of installing Python within an Electron app.
151
+
152
+ * [OBS](https://obsproject.com/) and [FFMPEG](https://ffmpeg.org/), without which GSM would not be possible.
153
+
154
+ ## Donations
155
+
156
+ If you've found this or any of my other projects helpful, please consider supporting my work through [GitHub Sponsors](https://github.com/sponsors/bpwhelan) or [Ko-fi](https://ko-fi.com/beangate).
@@ -0,0 +1,115 @@
1
+ # GameSentenceMiner (GSM)
2
+
3
+ An application designed to assist with language learning through games. Aiming to be the "[asbplayer](https://github.com/killergerbah/asbplayer)" for games.
4
+
5
+ Short Demo (Watch this first): https://www.youtube.com/watch?v=FeFBL7py6HY
6
+
7
+ Installation: https://youtu.be/h5ksXallc-o
8
+
9
+ Discord: https://discord.gg/yP8Qse6bb8
10
+
11
+ ## Features
12
+
13
+ ### Anki Card Enhancement
14
+
15
+ GSM significantly enhances your Anki cards with rich contextual information:
16
+
17
+ * **Automated Audio Capture**: Automatically records the voice line associated with the text.
18
+
19
+ * **Automatic Trim**: Some simple math around the time that the text event came in, in combination with a "Voice Activation Detection" (VAD) library gives us neatly cut audio.
20
+ * **Manual Trim**: If Automatic voiceline trim is not perfect, it's possible to [open the audio in an external program](https://youtu.be/LKFQFy2Qm64) for trimming.
21
+
22
+ * **Screenshot**: Captures a screenshot of the game at the moment the voice line is spoken.
23
+
24
+ * **Multi-Line**: It's possible to capture multiple lines at once with sentence audio with GSM's very own Texthooker.
25
+
26
+ * **AI Translation**: Integrates AI to provide quick translations of the captured sentence. Custom Prompts also supported. (Optional, Bring your own Key)
27
+
28
+
29
+ #### Game Example
30
+ ![anki_RozcrisS8B](https://github.com/user-attachments/assets/b1f08150-6b46-4d7d-ad90-e6c468076b05)
31
+
32
+ Audio: https://github.com/user-attachments/assets/94360986-8dbf-42c9-b3c3-d054893eac3d
33
+
34
+ ---
35
+
36
+ #### VN Example
37
+ ![anki_Lk3Ds2T1Bz](https://github.com/user-attachments/assets/e8ae4d66-f138-4ae1-9df7-46e16249be41)
38
+
39
+ Audio: https://github.com/user-attachments/assets/2d7b3967-cd5c-4132-b489-75058ea20921
40
+
41
+
42
+ ### OCR
43
+
44
+ GSM integrates with [OwOCR](https://github.com/AuroraWright/owocr/) to provide accurate text capture from games that do not have a hook. Here are some improvements GSM makes on stock OwOCR:
45
+
46
+ * **Easier Setup**: With GSM's managed Python install, setup is only a matter of clicking a few buttons.
47
+
48
+ * **Exclusion Zones**: Instead of choosing an area to OCR, you can choose an area to exclude from OCR. Useful if you have a static interface in your game and text appears randomly throughout.
49
+
50
+ * **Two-Pass OCR**: To cut down on API calls and keep output clean, GSM features a "Two-Pass" OCR System. A Local OCR will be constantly running, and when the text on screen stabilizes, it will run a second, more accurate scan that gets sent to clipboard/WebSocket.
51
+
52
+ * **Consistent Audio Timing**: With the two-pass system, we can still get accurate audio recorded and into Anki without the use of crazy offsets or hacks.
53
+
54
+ * **More Language Support**: Stock OwOCR is hard-coded to Japanese, while in GSM you can use a variety of languages.
55
+
56
+
57
+ ![GameSentenceMiner_efBTEpbZ2A](https://github.com/user-attachments/assets/4b873f9e-c049-428c-9bfd-20907e095054)
58
+ ![anki_f3PdqYLN2n](https://github.com/user-attachments/assets/a901221c-6f7c-471b-a1f3-f29e8ced102c)
59
+
60
+ Audio: https://github.com/user-attachments/assets/8c44780a-9b74-41af-bf16-28a742f4de12
61
+
62
+
63
+ ### Game Launcher Capabilities (WIP)
64
+
65
+ This is probably the feature I care least about, but if you are lazy like me, you may find this helpful.
66
+
67
+ * **Launch**: GSM can launch your games directly, simplifying the setup process.
68
+
69
+ * **Hook**: Streamlines the process of hooking your games (Agent).
70
+
71
+ This feature simplifies the process of launching games and (potentially) hooking them, making the entire workflow more efficient.
72
+
73
+ ![image](https://github.com/user-attachments/assets/eb630535-d291-4386-a5af-9f54b718896a)
74
+
75
+ ## Basic Requirements
76
+
77
+ * **Anki card creation tool**: [Yomitan](https://github.com/yomidevs/yomitan), [JL](https://github.com/rampaa/JL), etc.
78
+
79
+ * **A method of getting text from the game**: [Agent](https://github.com/0xDC00/agent), [Textractor](https://github.com/Artikash/Textractor), [LunaTranslator](https://github.com/HIllya51/LunaTranslator), GSM's OCR, etc.
80
+
81
+ * **A game :)**
82
+
83
+ ## Documentation
84
+
85
+ For help with installation, setup, and other information, please visit the project's [Wiki](https://github.com/bpwhelan/GameSentenceMiner/wiki).
86
+
87
+ ## FAQ
88
+
89
+ ### How Does It Work?
90
+
91
+ This is a common question, and understanding this process will help clarify any issues you might encounter while using GSM.
92
+
93
+ 1. The beginning of the voice line is marked by a text event. This usually comes from Textractor, Agent, or another texthooker. GSM can listen for a clipboard copy and/or a WebSocket server (configurable in GSM).
94
+
95
+ 2. The end of the voice line is detected using a Voice Activity Detection (VAD) library running locally. ([Example](https://github.com/snakers4/silero-vad))
96
+
97
+ In essence, GSM relies on accurately timed text events to capture the corresponding audio.
98
+
99
+ GSM provides settings to accommodate less-than-ideal hooks. However, if you experience significant audio inconsistencies, they likely stem from a poorly timed hook, loud background music, or other external factors, rather than GSM itself. The core audio trimming logic has been stable and effective for many users across various games.
100
+
101
+ ## Contact
102
+
103
+ If you encounter issues, please ask for help in my [Discord](https://discord.gg/yP8Qse6bb8) or create an issue here.
104
+
105
+ ## Acknowledgements
106
+
107
+ * [OwOCR](https://github.com/AuroraWright/owocr) for their outstanding OCR implementation, which I've integrated into GSM.
108
+
109
+ * [chaiNNer](https://github.com/chaiNNer-org/chaiNNer) for the idea of installing Python within an Electron app.
110
+
111
+ * [OBS](https://obsproject.com/) and [FFMPEG](https://ffmpeg.org/), without which GSM would not be possible.
112
+
113
+ ## Donations
114
+
115
+ If you've found this or any of my other projects helpful, please consider supporting my work through [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.8.22"
10
+ version = "2.8.24"
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,132 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: GameSentenceMiner
3
- Version: 2.8.22
4
- Summary: A tool for mining sentences from games. Update: Multi-Line Mining! Fixed!
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.10
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE
15
- Requires-Dist: requests~=2.32.3
16
- Requires-Dist: watchdog~=5.0.2
17
- Requires-Dist: DateTime~=5.5
18
- Requires-Dist: pyperclip~=1.9.0
19
- Requires-Dist: vosk~=0.3.45
20
- Requires-Dist: soundfile~=0.12.1
21
- Requires-Dist: toml~=0.10.2
22
- Requires-Dist: psutil~=6.0.0
23
- Requires-Dist: rapidfuzz~=3.9.7
24
- Requires-Dist: obs-websocket-py~=1.0
25
- Requires-Dist: plyer~=2.1.0
26
- Requires-Dist: keyboard~=0.13.5
27
- Requires-Dist: websockets~=15.0.1
28
- Requires-Dist: stable-ts~=2.17.5
29
- Requires-Dist: silero-vad~=5.1.2
30
- Requires-Dist: ttkbootstrap~=1.10.1
31
- Requires-Dist: dataclasses_json~=0.6.7
32
- Requires-Dist: win10toast
33
- Requires-Dist: numpy
34
- Requires-Dist: pystray
35
- Requires-Dist: pywin32; sys_platform == "win32"
36
- Requires-Dist: google-generativeai
37
- Requires-Dist: pygetwindow; sys_platform == "win32"
38
- Requires-Dist: flask
39
- Requires-Dist: groq
40
- Dynamic: license-file
41
-
42
- # Game Sentence Miner
43
-
44
- This project automates the recording of game sentence audio to help with Anki Card Creation.
45
-
46
- This allows us to create cards from texthooker/yomitan, and automatically get screenshot and sentence audio from the
47
- game we are playing.
48
-
49
- Short Demo (Watch this first): https://www.youtube.com/watch?v=FeFBL7py6HY
50
-
51
- Installation: https://youtu.be/h5ksXallc-o
52
-
53
- ## How Does it Work?
54
-
55
- 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.
56
-
57
- 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).
58
- 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))
59
-
60
- That's it.
61
-
62
- 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.
63
-
64
- ## Features:
65
-
66
- - **OBS Replay Buffer**: Constantly records the last X seconds of gameplay.
67
- - **Voice Activity Detection**: Automatically cuts the end of the clip to the exact moment the voice ended.
68
- - **Clipboard Interaction**: Automatically monitors the clipboard for dialogue events.
69
- - **Websocket Listening**: Listens to a websocket uri for text-events from stuff like Agent/Textractor.
70
- - **Hotkey Automation**: Single hotkey to trigger video recording, screenshot, and transcription.
71
- - **1-Click Card Creation**: Monitors anki for new cards from Yomitan, and automatically gets audio from games.
72
-
73
- ---
74
-
75
- ## Documentation
76
-
77
- Help with Installation, Setup, and other information can be found in the project's [Wiki](https://github.com/bpwhelan/GameSentenceMiner/wiki).
78
-
79
- ## Example Process
80
-
81
- 1. Start script: `gamesentenceminer`
82
- 2. Start game
83
- 3. Hook Game with Agent (or textractor) with clipboard enabled
84
- 4. Create Anki Card with target word (through a texthooker page/Yomitan)
85
- 5. When finished gaming, End script (not required)
86
-
87
- Once the Anki card is created:
88
-
89
- 1. **OBS** will save the last X seconds of gameplay.
90
- 2. The Python script will trim the audio based on last clipboard event, and the end of voice line detected in VAD if
91
- enabled.
92
- 3. Will attempt to update the LAST anki card created.
93
-
94
- ---
95
-
96
- ## Disclaimer/Troubleshooting
97
-
98
- Every game/hook is different, so it's really impossible that any script can get it perfect every time. Also OBS is
99
- sometimes a bit finicky if running for too long. If the audio timing is off, please first try some troubleshooting
100
- steps before making an issue:
101
-
102
- - Try Restarting OBS
103
- - Make sure your hook is the best you can find. (Preferably it gives you the text RIGHT when the voice line starts)
104
- - Try Adjusting Offset Configuration in the config to better match your situation. (i.e. if the hook is late, add a
105
- negative beginning offset)
106
- - Try using "Trim beginning" in `VAD` settings.
107
-
108
- ### Setup Troubleshooting
109
-
110
- Just going to continuously update this with issues that I have helped users with. Look here first if you have issues
111
- setting it up.
112
-
113
- - Make sure folder_to_watch is the same as your recordings path in OBS. It defaults to ~/Videos, but I recommend setting
114
- it to ~/Videos/GSM.
115
- - If using clipboard, make sure Agent/Textractor sending to clipboard is enabled.
116
- - 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.
117
-
118
-
119
- ## Contact
120
-
121
- If you run into issues ask in my [Discord](https://discord.gg/yP8Qse6bb8), or make an issue here.
122
-
123
- ## Acknowledgements
124
-
125
- - [OwOCR](https://github.com/AuroraWright/owocr) for their amazing implementation of OCR that I was able to integrate into GSM.
126
- - [chaiNNer](https://github.com/chaiNNer-org/chaiNNer) for the idea of installing python in an electron app.
127
- - [OBS](https://obsproject.com/) and [FFMPEG](https://ffmpeg.org/), without these two, GSM would not be a thing.
128
-
129
- ## Donations
130
-
131
- If you've benefited from this or any of my other projects, please consider supporting my work
132
- via [Github Sponsors](https://github.com/sponsors/bpwhelan) or [Ko-fi.](https://ko-fi.com/beangate)
@@ -1,132 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: GameSentenceMiner
3
- Version: 2.8.22
4
- Summary: A tool for mining sentences from games. Update: Multi-Line Mining! Fixed!
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.10
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE
15
- Requires-Dist: requests~=2.32.3
16
- Requires-Dist: watchdog~=5.0.2
17
- Requires-Dist: DateTime~=5.5
18
- Requires-Dist: pyperclip~=1.9.0
19
- Requires-Dist: vosk~=0.3.45
20
- Requires-Dist: soundfile~=0.12.1
21
- Requires-Dist: toml~=0.10.2
22
- Requires-Dist: psutil~=6.0.0
23
- Requires-Dist: rapidfuzz~=3.9.7
24
- Requires-Dist: obs-websocket-py~=1.0
25
- Requires-Dist: plyer~=2.1.0
26
- Requires-Dist: keyboard~=0.13.5
27
- Requires-Dist: websockets~=15.0.1
28
- Requires-Dist: stable-ts~=2.17.5
29
- Requires-Dist: silero-vad~=5.1.2
30
- Requires-Dist: ttkbootstrap~=1.10.1
31
- Requires-Dist: dataclasses_json~=0.6.7
32
- Requires-Dist: win10toast
33
- Requires-Dist: numpy
34
- Requires-Dist: pystray
35
- Requires-Dist: pywin32; sys_platform == "win32"
36
- Requires-Dist: google-generativeai
37
- Requires-Dist: pygetwindow; sys_platform == "win32"
38
- Requires-Dist: flask
39
- Requires-Dist: groq
40
- Dynamic: license-file
41
-
42
- # Game Sentence Miner
43
-
44
- This project automates the recording of game sentence audio to help with Anki Card Creation.
45
-
46
- This allows us to create cards from texthooker/yomitan, and automatically get screenshot and sentence audio from the
47
- game we are playing.
48
-
49
- Short Demo (Watch this first): https://www.youtube.com/watch?v=FeFBL7py6HY
50
-
51
- Installation: https://youtu.be/h5ksXallc-o
52
-
53
- ## How Does it Work?
54
-
55
- 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.
56
-
57
- 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).
58
- 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))
59
-
60
- That's it.
61
-
62
- 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.
63
-
64
- ## Features:
65
-
66
- - **OBS Replay Buffer**: Constantly records the last X seconds of gameplay.
67
- - **Voice Activity Detection**: Automatically cuts the end of the clip to the exact moment the voice ended.
68
- - **Clipboard Interaction**: Automatically monitors the clipboard for dialogue events.
69
- - **Websocket Listening**: Listens to a websocket uri for text-events from stuff like Agent/Textractor.
70
- - **Hotkey Automation**: Single hotkey to trigger video recording, screenshot, and transcription.
71
- - **1-Click Card Creation**: Monitors anki for new cards from Yomitan, and automatically gets audio from games.
72
-
73
- ---
74
-
75
- ## Documentation
76
-
77
- Help with Installation, Setup, and other information can be found in the project's [Wiki](https://github.com/bpwhelan/GameSentenceMiner/wiki).
78
-
79
- ## Example Process
80
-
81
- 1. Start script: `gamesentenceminer`
82
- 2. Start game
83
- 3. Hook Game with Agent (or textractor) with clipboard enabled
84
- 4. Create Anki Card with target word (through a texthooker page/Yomitan)
85
- 5. When finished gaming, End script (not required)
86
-
87
- Once the Anki card is created:
88
-
89
- 1. **OBS** will save the last X seconds of gameplay.
90
- 2. The Python script will trim the audio based on last clipboard event, and the end of voice line detected in VAD if
91
- enabled.
92
- 3. Will attempt to update the LAST anki card created.
93
-
94
- ---
95
-
96
- ## Disclaimer/Troubleshooting
97
-
98
- Every game/hook is different, so it's really impossible that any script can get it perfect every time. Also OBS is
99
- sometimes a bit finicky if running for too long. If the audio timing is off, please first try some troubleshooting
100
- steps before making an issue:
101
-
102
- - Try Restarting OBS
103
- - Make sure your hook is the best you can find. (Preferably it gives you the text RIGHT when the voice line starts)
104
- - Try Adjusting Offset Configuration in the config to better match your situation. (i.e. if the hook is late, add a
105
- negative beginning offset)
106
- - Try using "Trim beginning" in `VAD` settings.
107
-
108
- ### Setup Troubleshooting
109
-
110
- Just going to continuously update this with issues that I have helped users with. Look here first if you have issues
111
- setting it up.
112
-
113
- - Make sure folder_to_watch is the same as your recordings path in OBS. It defaults to ~/Videos, but I recommend setting
114
- it to ~/Videos/GSM.
115
- - If using clipboard, make sure Agent/Textractor sending to clipboard is enabled.
116
- - 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.
117
-
118
-
119
- ## Contact
120
-
121
- If you run into issues ask in my [Discord](https://discord.gg/yP8Qse6bb8), or make an issue here.
122
-
123
- ## Acknowledgements
124
-
125
- - [OwOCR](https://github.com/AuroraWright/owocr) for their amazing implementation of OCR that I was able to integrate into GSM.
126
- - [chaiNNer](https://github.com/chaiNNer-org/chaiNNer) for the idea of installing python in an electron app.
127
- - [OBS](https://obsproject.com/) and [FFMPEG](https://ffmpeg.org/), without these two, GSM would not be a thing.
128
-
129
- ## Donations
130
-
131
- If you've benefited from this or any of my other projects, please consider supporting my work
132
- via [Github Sponsors](https://github.com/sponsors/bpwhelan) or [Ko-fi.](https://ko-fi.com/beangate)
@@ -1,91 +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
- ---
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 the config 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
- ## Acknowledgements
83
-
84
- - [OwOCR](https://github.com/AuroraWright/owocr) for their amazing implementation of OCR that I was able to integrate into GSM.
85
- - [chaiNNer](https://github.com/chaiNNer-org/chaiNNer) for the idea of installing python in an electron app.
86
- - [OBS](https://obsproject.com/) and [FFMPEG](https://ffmpeg.org/), without these two, GSM would not be a thing.
87
-
88
- ## Donations
89
-
90
- If you've benefited from this or any of my other projects, please consider supporting my work
91
- via [Github Sponsors](https://github.com/sponsors/bpwhelan) or [Ko-fi.](https://ko-fi.com/beangate)