GameSentenceMiner 2.8.26__py3-none-any.whl → 2.8.28__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()
@@ -30,8 +31,7 @@ def process_audio_with_silero(input_audio, output_audio):
30
31
  voice_activity = detect_voice_with_silero(input_audio)
31
32
 
32
33
  if not voice_activity:
33
- logger.info("No voice activity detected in the audio.")
34
- return False, 0, 0
34
+ return VADResult(False, 0, 0)
35
35
 
36
36
  # Trim based on the first and last speech detected
37
37
  start_time = voice_activity[0]['start'] if voice_activity else 0
@@ -39,5 +39,4 @@ def process_audio_with_silero(input_audio, output_audio):
39
39
 
40
40
  # Trim the audio using FFmpeg
41
41
  ffmpeg.trim_audio(input_audio, start_time + get_config().vad.beginning_offset, end_time + get_config().audio.end_offset, output_audio)
42
- 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
42
+ 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,22 +128,21 @@ 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
134
135
  end_time = voice_activity[-1]['end'] if voice_activity else total_duration
135
136
 
136
137
  if get_config().vad.trim_beginning:
137
- logger.info(f"Trimmed Beginning of Audio to {start_time}")
138
+ logger.info(f"VAD Trimmed Beginning of Audio to {start_time}")
138
139
 
139
140
  # Print detected speech details with timestamps
140
- logger.info(f"Trimmed End of Audio to {end_time} seconds:")
141
+ logger.info(f"VAD Trimmed End of Audio to {end_time} seconds:")
141
142
 
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
- 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
145
+ return VADResult(True, start_time + get_config().vad.beginning_offset, end_time + get_config().audio.end_offset)
146
146
 
147
147
 
148
148
  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,22 +75,21 @@ 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']
81
82
  end_time = voice_activity[-1]['end']
82
83
 
83
84
  if get_config().vad.trim_beginning:
84
- logger.info(f"Trimmed Beginning of Audio to {start_time}")
85
+ logger.info(f"VAD Trimmed Beginning of Audio to {start_time}")
85
86
 
86
87
  # Print detected speech details with timestamps
87
- logger.info(f"Trimmed End of Audio to {end_time} seconds:")
88
+ logger.info(f"VAD Trimmed End of Audio to {end_time} seconds:")
88
89
 
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
- 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
92
+ return VADResult(True, start_time + get_config().vad.beginning_offset, end_time + get_config().audio.end_offset)
93
93
 
94
94
 
95
95
  # Load Whisper model initially
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.8.26
3
+ Version: 2.8.28
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=I98bvdxgZornaV1cnYux0-6AHnpEKkc4W56KCzOWC0s,14722
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=E-iMH8MoHwqyT6137xZ3eL8T74Ld6jWEBLlYXaSjnmM,14674
6
+ GameSentenceMiner/ffmpeg.py,sha256=Gcx45ZwUTDjQ3fQkz1xm0Hcd4pT0X0n7AlADFlL-Srg,14509
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=n34QKzyYWW4WxPLcpEzKy1h_emYajPgIVWMnAo-bcPo,26034
9
9
  GameSentenceMiner/model.py,sha256=JdnkT4VoPOXmOpRgFdvERZ09c9wLN6tUJxdrKlGZcqo,5305
10
10
  GameSentenceMiner/notification.py,sha256=FY39ChSRK0Y8TQ6lBGsLnpZUFPtFpSy2tweeXVoV7kc,2809
11
11
  GameSentenceMiner/obs.py,sha256=-tzVHejaGDXyERaDrRqrKmbgwT13oJKxTivGwfUij7Y,10284
@@ -13,7 +13,7 @@ GameSentenceMiner/package.py,sha256=YlS6QRMuVlm6mdXx0rlXv9_3erTGS21jaP3PNNWfAH0,
13
13
  GameSentenceMiner/text_log.py,sha256=MD7LB5D-v4G0Bnm3uGvZQ0aV38Fcj4E0vgq7mmyQ7_4,5157
14
14
  GameSentenceMiner/util.py,sha256=LzWGIDZb8NLv-RyrE_d6ycoQEwM1zpaDhWp0LKb6_Zc,8928
15
15
  GameSentenceMiner/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- GameSentenceMiner/ai/ai_prompting.py,sha256=uTtXIDRpcQqPT4EC-R_pwRP9pBmZ64I6vMDOexhJRp8,9505
16
+ GameSentenceMiner/ai/ai_prompting.py,sha256=O1QBgCL6AkkDyhzxZuW8FPCKgUDfkl_ZlKGcEUfbRnk,9508
17
17
  GameSentenceMiner/communication/__init__.py,sha256=_jGn9PJxtOAOPtJ2rI-Qu9hEHVZVpIvWlxKvqk91_zI,638
18
18
  GameSentenceMiner/communication/send.py,sha256=oOJdCS6-LNX90amkRn5FL2xqx6THGm56zHR2ntVIFTE,229
19
19
  GameSentenceMiner/communication/websocket.py,sha256=pTcUe_ZZRp9REdSU4qalhPmbT_1DKa7w18j6RfFLELA,3074
@@ -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=L5OYAPi-L4uDn4nVAmTmdyrD_mVbmMbEXgQ7U16Kyjw,1631
39
+ GameSentenceMiner/vad/vosk_helper.py,sha256=0NoqzuMjcl3ueZv_KAcLt92el-38g-aTpl1fLs91PrA,6092
40
+ GameSentenceMiner/vad/whisper_helper.py,sha256=ulWDJypfBC6nEZyWp5j5nVCNeEukKvMiqWthMvIzvp4,3565
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.26.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
55
- gamesentenceminer-2.8.26.dist-info/METADATA,sha256=VnvxmAuL5qDCJilS2bFldkoFl2vK3XgPjbEykD4AWXA,7165
56
- gamesentenceminer-2.8.26.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
57
- gamesentenceminer-2.8.26.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
58
- gamesentenceminer-2.8.26.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
59
- gamesentenceminer-2.8.26.dist-info/RECORD,,
55
+ gamesentenceminer-2.8.28.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
56
+ gamesentenceminer-2.8.28.dist-info/METADATA,sha256=_DbgnRKkjL_Or7o4MCvXOhBgWKtCuBNuZzODY_HU_R4,7165
57
+ gamesentenceminer-2.8.28.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
58
+ gamesentenceminer-2.8.28.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
59
+ gamesentenceminer-2.8.28.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
60
+ gamesentenceminer-2.8.28.dist-info/RECORD,,