GameSentenceMiner 2.8.25__py3-none-any.whl → 2.8.27__py3-none-any.whl

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.
@@ -1,8 +1,9 @@
1
1
  from multiprocessing import Process, Manager
2
2
  import mss
3
- from PIL import Image, ImageTk
3
+ from PIL import Image
4
4
 
5
5
  try:
6
+ from PIL import ImageTk
6
7
  import tkinter as tk
7
8
  selector_available = True
8
9
  except:
@@ -85,7 +86,7 @@ def run_screen_selector(result):
85
86
 
86
87
  def get_screen_selection():
87
88
  if not selector_available:
88
- raise ValueError('tkinter is not installed, unable to open picker')
89
+ raise ValueError('tkinter or PIL with tkinter support are not installed, unable to open picker')
89
90
 
90
91
  with Manager() as manager:
91
92
  res = manager.dict()
@@ -0,0 +1,8 @@
1
+ class VADResult:
2
+ def __init__(self, success: bool, start: float, end: float):
3
+ self.success = success
4
+ self.start = start
5
+ self.end = end
6
+
7
+ def __repr__(self):
8
+ return f"VADResult(success={self.success}, start={self.start}, end={self.end})"
@@ -4,6 +4,7 @@ from silero_vad import load_silero_vad, read_audio, get_speech_timestamps
4
4
 
5
5
  from GameSentenceMiner import configuration, ffmpeg
6
6
  from GameSentenceMiner.configuration import *
7
+ from GameSentenceMiner.vad.result import VADResult
7
8
 
8
9
  # Silero VAD setup
9
10
  vad_model = load_silero_vad()
@@ -31,7 +32,7 @@ def process_audio_with_silero(input_audio, output_audio):
31
32
 
32
33
  if not voice_activity:
33
34
  logger.info("No voice activity detected in the audio.")
34
- return False, 0, 0
35
+ return VADResult(False, 0, 0)
35
36
 
36
37
  # Trim based on the first and last speech detected
37
38
  start_time = voice_activity[0]['start'] if voice_activity else 0
@@ -40,4 +41,4 @@ def process_audio_with_silero(input_audio, output_audio):
40
41
  # Trim the audio using FFmpeg
41
42
  ffmpeg.trim_audio(input_audio, start_time + get_config().vad.beginning_offset, end_time + get_config().audio.end_offset, output_audio)
42
43
  logger.info(f"Trimmed audio saved to: {output_audio}")
43
- return True, start_time + get_config().vad.beginning_offset, end_time + get_config().audio.end_offset
44
+ return VADResult(True, start_time + get_config().vad.beginning_offset, end_time + get_config().audio.end_offset)
@@ -9,6 +9,7 @@ import vosk
9
9
 
10
10
  from GameSentenceMiner import configuration, ffmpeg
11
11
  from GameSentenceMiner.configuration import *
12
+ from GameSentenceMiner.vad.result import VADResult
12
13
 
13
14
  ffmpeg_base_command_list = ["ffmpeg", "-hide_banner", "-loglevel", "error"]
14
15
  vosk.SetLogLevel(-1)
@@ -127,7 +128,7 @@ def process_audio_with_vosk(input_audio, output_audio):
127
128
 
128
129
  if not voice_activity:
129
130
  logger.info("No voice activity detected in the audio.")
130
- return False, 0, 0
131
+ return VADResult(False, 0, 0)
131
132
 
132
133
  # Trim based on the first and last speech detected
133
134
  start_time = voice_activity[0]['start'] if voice_activity else 0
@@ -142,7 +143,7 @@ def process_audio_with_vosk(input_audio, output_audio):
142
143
  # Trim the audio using FFmpeg
143
144
  ffmpeg.trim_audio(input_audio, start_time + get_config().vad.beginning_offset, end_time + get_config().audio.end_offset, output_audio)
144
145
  logger.info(f"Trimmed audio saved to: {output_audio}")
145
- return True, start_time + get_config().vad.beginning_offset, end_time + get_config().audio.end_offset
146
+ return VADResult(True, start_time + get_config().vad.beginning_offset, end_time + get_config().audio.end_offset)
146
147
 
147
148
 
148
149
  def get_vosk_model():
@@ -6,6 +6,7 @@ from stable_whisper import WhisperResult
6
6
 
7
7
  from GameSentenceMiner import configuration, ffmpeg
8
8
  from GameSentenceMiner.configuration import *
9
+ from GameSentenceMiner.vad.result import VADResult
9
10
 
10
11
  ffmpeg_base_command_list = ["ffmpeg", "-hide_banner", "-loglevel", "error"]
11
12
  whisper_model = None
@@ -74,7 +75,7 @@ def process_audio_with_whisper(input_audio, output_audio):
74
75
 
75
76
  if not voice_activity:
76
77
  logger.info("No voice activity detected in the audio.")
77
- return False, 0, 0
78
+ return VADResult(False, 0, 0)
78
79
 
79
80
  # Trim based on the first and last speech detected
80
81
  start_time = voice_activity[0]['start']
@@ -89,7 +90,7 @@ def process_audio_with_whisper(input_audio, output_audio):
89
90
  # Trim the audio using FFmpeg
90
91
  ffmpeg.trim_audio(input_audio, start_time + get_config().vad.beginning_offset, end_time + get_config().audio.end_offset, output_audio)
91
92
  logger.info(f"Trimmed audio saved to: {output_audio}")
92
- return True, start_time + get_config().vad.beginning_offset, end_time + get_config().audio.end_offset
93
+ return VADResult(True, start_time + get_config().vad.beginning_offset, end_time + get_config().audio.end_offset)
93
94
 
94
95
 
95
96
  # Load Whisper model initially
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.8.25
3
+ Version: 2.8.27
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
@@ -1,11 +1,11 @@
1
1
  GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- GameSentenceMiner/anki.py,sha256=OCLgZa-iEp93v-R0zKFkDCjule_EAoP5rIqtnMHLnOw,14226
2
+ GameSentenceMiner/anki.py,sha256=I1rvmQry5mtdJHFqNYvG8dyV1A-mwgkCANXTtU-bRuQ,14491
3
3
  GameSentenceMiner/config_gui.py,sha256=R7pUJDXCP7unGtBpuUjL0-8iWvY6LXRCYckHIrwkvF8,74207
4
4
  GameSentenceMiner/configuration.py,sha256=ndnxuQbLfhMruHld-yK3UjWt1DcXlVhaLRZD8l6SJ0E,22562
5
5
  GameSentenceMiner/electron_config.py,sha256=dGcPYCISPehXubYSzsDuI2Gl092MYK0u3bTnkL9Jh1Y,9787
6
- GameSentenceMiner/ffmpeg.py,sha256=MUfKfqM8CoxPwH6Glo0JnGJjxmD4htM9Y3rf0ZysbRk,14663
6
+ GameSentenceMiner/ffmpeg.py,sha256=oYhWJgFMmW84vcYNw7sYLICZAX24KpgZbrR0VjuVqXQ,14672
7
7
  GameSentenceMiner/gametext.py,sha256=VogQDs-VQ4dorqy8uvoklweeS58r3Th_yP-zn36e0u4,5556
8
- GameSentenceMiner/gsm.py,sha256=B-84l3mCT4N1jidelXI0N8L9VPVdWcjoYl2NiS_xI_c,25388
8
+ GameSentenceMiner/gsm.py,sha256=-aAaCiIjoNK4G-XLUhj5kP3XKoc14GHr7JLka54pQT0,25611
9
9
  GameSentenceMiner/model.py,sha256=JdnkT4VoPOXmOpRgFdvERZ09c9wLN6tUJxdrKlGZcqo,5305
10
10
  GameSentenceMiner/notification.py,sha256=FY39ChSRK0Y8TQ6lBGsLnpZUFPtFpSy2tweeXVoV7kc,2809
11
11
  GameSentenceMiner/obs.py,sha256=-tzVHejaGDXyERaDrRqrKmbgwT13oJKxTivGwfUij7Y,10284
@@ -25,18 +25,19 @@ GameSentenceMiner/ocr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
25
25
  GameSentenceMiner/ocr/gsm_ocr_config.py,sha256=rQC6C8PKJXWoAvwCOYa363kodQQBwl1YNeYsD0bBbx4,1957
26
26
  GameSentenceMiner/ocr/ocrconfig.py,sha256=_tY8mjnzHMJrLS8E5pHqYXZjMuLoGKYgJwdhYgN-ny4,6466
27
27
  GameSentenceMiner/ocr/owocr_area_selector.py,sha256=sryQd7D33i7E6c8gO7dnxLWtL6Nghgs7cvppK-xFxiE,47076
28
- GameSentenceMiner/ocr/owocr_helper.py,sha256=ehQvhq_YjyR8PJYMhvz7M_BuwGAAUujfXgEpBNnAopA,17365
28
+ GameSentenceMiner/ocr/owocr_helper.py,sha256=motXED_wX_CUljXp0pIaziw2xFBpz6gjokD2icDz02k,17358
29
29
  GameSentenceMiner/owocr/owocr/__init__.py,sha256=opjBOyGGyEqZCE6YdZPnyt7nVfiwyELHsXA0jAsjm14,25
30
30
  GameSentenceMiner/owocr/owocr/__main__.py,sha256=XQaqZY99EKoCpU-gWQjNbTs7Kg17HvBVE7JY8LqIE0o,157
31
- GameSentenceMiner/owocr/owocr/config.py,sha256=n-xtVylb2Q_H84jb1ZsIGxPQjTNnyvnRny1RhtaLJM8,7550
31
+ GameSentenceMiner/owocr/owocr/config.py,sha256=qM7kISHdUhuygGXOxmgU6Ef2nwBShrZtdqu4InDCViE,8103
32
32
  GameSentenceMiner/owocr/owocr/lens_betterproto.py,sha256=oNoISsPilVVRBBPVDtb4-roJtAhp8ZAuFTci3TGXtMc,39141
33
- GameSentenceMiner/owocr/owocr/ocr.py,sha256=KDW9twGdgqE2UsmefxEvJmQVjCho_ll256LgoCcO_qQ,43242
34
- GameSentenceMiner/owocr/owocr/run.py,sha256=u8raw0KUSKZbMWxVWblKULGtA2walHM54PrK3A_2b_U,51001
35
- GameSentenceMiner/owocr/owocr/screen_coordinate_picker.py,sha256=fjJ3CSXLti3WboGPpmsa7MWOwIXsfpHC8N4zKahGGY0,3346
33
+ GameSentenceMiner/owocr/owocr/ocr.py,sha256=dPnDmtG-I24kcfxC3iudeRIVgGhLmiWMGyRiMANcYsA,41573
34
+ GameSentenceMiner/owocr/owocr/run.py,sha256=f59MhlV9JVpzFAq7aW-_0I3FGnzKyw0OLOAggWCiRvY,52083
35
+ GameSentenceMiner/owocr/owocr/screen_coordinate_picker.py,sha256=Na6XStbQBtpQUSdbN3QhEswtKuU1JjReFk_K8t5ezQE,3395
36
36
  GameSentenceMiner/vad/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
- GameSentenceMiner/vad/silero_trim.py,sha256=ULf3zwS-JMsY82cKF7gZxREHw8L6lgpWF2U1YqgE9Oc,1681
38
- GameSentenceMiner/vad/vosk_helper.py,sha256=125X8C9NxFPlWWpoNsbOnEqKx8RCjXN109zNx_QXhyg,6070
39
- GameSentenceMiner/vad/whisper_helper.py,sha256=JJ-iltCh813XdjyEw0Wn5DaErf6PDqfH0Efu1Md8cIY,3543
37
+ GameSentenceMiner/vad/result.py,sha256=C08HsYH4qVjTRh_dvrWrskmXHJ950w0GWxPjGx_BfGY,275
38
+ GameSentenceMiner/vad/silero_trim.py,sha256=c9T7td5kaSA0fokRHl84LiRXUtETyMULUw4UfSjZisA,1754
39
+ GameSentenceMiner/vad/vosk_helper.py,sha256=ZrR3WLX8PC4pl9ONzkkalUVyiDexjKrmf9hqsDG-ej0,6143
40
+ GameSentenceMiner/vad/whisper_helper.py,sha256=G164s1SE5k_W9bPXKsKTIAG68pzisgzTJ8ByvBmhSQg,3616
40
41
  GameSentenceMiner/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
42
  GameSentenceMiner/web/texthooking_page.py,sha256=AtVV9RS7HC3XnOq4X0FIMqJrzFoGlfSHFvS_CfhuzuA,13558
42
43
  GameSentenceMiner/web/static/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -51,9 +52,9 @@ GameSentenceMiner/web/static/web-app-manifest-512x512.png,sha256=wyqgCWCrLEUxSRX
51
52
  GameSentenceMiner/web/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
53
  GameSentenceMiner/web/templates/text_replacements.html,sha256=tV5c8mCaWSt_vKuUpbdbLAzXZ3ATZeDvQ9PnnAfqY0M,8598
53
54
  GameSentenceMiner/web/templates/utility.html,sha256=NUp4Yjs6_j7YeqsM2rcF0LzwS6nXSBUWJDl-k2E8BbM,16270
54
- gamesentenceminer-2.8.25.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
55
- gamesentenceminer-2.8.25.dist-info/METADATA,sha256=T81bjWrg4heXOyw8-IjJl71AJWc_BqXZIlF00TcH3uM,7165
56
- gamesentenceminer-2.8.25.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
57
- gamesentenceminer-2.8.25.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
58
- gamesentenceminer-2.8.25.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
59
- gamesentenceminer-2.8.25.dist-info/RECORD,,
55
+ gamesentenceminer-2.8.27.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
56
+ gamesentenceminer-2.8.27.dist-info/METADATA,sha256=YyFsH_0pIvAzqRYC0srO-cFN4xHyvT5GBdmfiSt3PBg,7165
57
+ gamesentenceminer-2.8.27.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
58
+ gamesentenceminer-2.8.27.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
59
+ gamesentenceminer-2.8.27.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
60
+ gamesentenceminer-2.8.27.dist-info/RECORD,,