GameSentenceMiner 2.2.1__py3-none-any.whl → 2.2.2.post1__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.
@@ -6,12 +6,12 @@ import urllib.request
6
6
 
7
7
  import requests as req
8
8
 
9
- from src import obs, util, notification, ffmpeg
9
+ from GameSentenceMiner import obs, util, notification, ffmpeg
10
10
 
11
- from src.configuration import *
12
- from src.configuration import get_config
13
- from src.gametext import get_last_two_sentences
14
- from src.obs import get_current_game
11
+ from GameSentenceMiner.configuration import *
12
+ from GameSentenceMiner.configuration import get_config
13
+ from GameSentenceMiner.gametext import get_last_two_sentences
14
+ from GameSentenceMiner.obs import get_current_game
15
15
 
16
16
  audio_in_anki = None
17
17
  screenshot_in_anki = None
@@ -3,9 +3,9 @@ from tkinter import filedialog, messagebox, simpledialog
3
3
 
4
4
  import ttkbootstrap as ttk
5
5
 
6
- from src.package_updater import check_for_updates, get_latest_version, update, get_current_version
7
- from src import obs, configuration
8
- from src.configuration import *
6
+ from GameSentenceMiner.package_updater import check_for_updates, get_latest_version, update, get_current_version
7
+ from GameSentenceMiner import obs, configuration
8
+ from GameSentenceMiner.configuration import *
9
9
 
10
10
  settings_saved = False
11
11
  on_save = []
@@ -6,8 +6,8 @@ import urllib.request
6
6
  import platform
7
7
  import zipfile
8
8
 
9
- from src.downloader.Untitled_json import scenes
10
- from src.configuration import get_app_directory, logger
9
+ from GameSentenceMiner.downloader.Untitled_json import scenes
10
+ from GameSentenceMiner.configuration import get_app_directory, logger
11
11
 
12
12
  script_dir = os.path.dirname(os.path.abspath(__file__))
13
13
 
@@ -2,9 +2,9 @@ import subprocess
2
2
  import tempfile
3
3
  import time
4
4
 
5
- from src import obs, util, configuration
6
- from src.configuration import *
7
- from src.util import *
5
+ from GameSentenceMiner import obs, util, configuration
6
+ from GameSentenceMiner.configuration import *
7
+ from GameSentenceMiner.util import *
8
8
 
9
9
  def get_ffmpeg_path():
10
10
  return os.path.join(get_app_directory(), "ffmpeg", "ffmpeg.exe") if util.is_windows() else "ffmpeg"
@@ -7,10 +7,10 @@ from datetime import datetime
7
7
  import pyperclip
8
8
  import websockets
9
9
 
10
- from src import util
11
- from src.configuration import *
12
- from src.configuration import get_config, logger
13
- from src.util import remove_html_tags
10
+ from GameSentenceMiner import util
11
+ from GameSentenceMiner.configuration import *
12
+ from GameSentenceMiner.configuration import get_config, logger
13
+ from GameSentenceMiner.util import remove_html_tags
14
14
  from difflib import SequenceMatcher
15
15
 
16
16
 
@@ -6,26 +6,28 @@ from subprocess import Popen
6
6
 
7
7
  import keyboard
8
8
  import psutil
9
- import win32api
10
9
  from PIL import Image, ImageDraw
11
10
  from pystray import Icon, Menu, MenuItem
12
11
  from watchdog.events import FileSystemEventHandler
13
12
  from watchdog.observers import Observer
14
13
 
15
- from src import anki
16
- from src import config_gui
17
- from src import configuration
18
- from src import ffmpeg
19
- from src import gametext
20
- from src import notification
21
- from src import obs
22
- from src import util
23
- from src.downloader.download_tools import download_obs_if_needed, download_ffmpeg_if_needed
24
- from src.vad import vosk_helper, silero_trim, whisper_helper
25
- from src.configuration import *
26
- from src.ffmpeg import get_audio_and_trim
27
- from src.gametext import get_line_timing
28
- from src.util import *
14
+ from GameSentenceMiner import anki
15
+ from GameSentenceMiner import config_gui
16
+ from GameSentenceMiner import configuration
17
+ from GameSentenceMiner import ffmpeg
18
+ from GameSentenceMiner import gametext
19
+ from GameSentenceMiner import notification
20
+ from GameSentenceMiner import obs
21
+ from GameSentenceMiner import util
22
+ from GameSentenceMiner.downloader.download_tools import download_obs_if_needed, download_ffmpeg_if_needed
23
+ from GameSentenceMiner.vad import vosk_helper, silero_trim, whisper_helper
24
+ from GameSentenceMiner.configuration import *
25
+ from GameSentenceMiner.ffmpeg import get_audio_and_trim
26
+ from GameSentenceMiner.gametext import get_line_timing
27
+ from GameSentenceMiner.util import *
28
+
29
+ if is_windows():
30
+ import win32api
29
31
 
30
32
  obs_process: Popen
31
33
  procs_to_close = []
@@ -379,7 +381,8 @@ def main(reloading=False, do_config_input=True):
379
381
  # Register signal handlers for graceful shutdown
380
382
  signal.signal(signal.SIGTERM, handle_exit()) # Handle `kill` commands
381
383
  signal.signal(signal.SIGINT, handle_exit()) # Handle Ctrl+C
382
- win32api.SetConsoleCtrlHandler(handle_exit())
384
+ if is_windows():
385
+ win32api.SetConsoleCtrlHandler(handle_exit())
383
386
 
384
387
  util.run_new_thread(run_tray)
385
388
 
@@ -1,7 +1,7 @@
1
1
  import requests
2
2
  from plyer import notification
3
3
 
4
- from src.configuration import logger
4
+ from GameSentenceMiner.configuration import logger
5
5
 
6
6
 
7
7
  def open_anki_card(note_id):
@@ -3,9 +3,9 @@ import time
3
3
 
4
4
  from obswebsocket import obsws, requests
5
5
 
6
- from src import util, configuration
7
- from src.configuration import *
8
- from src.model import *
6
+ from GameSentenceMiner import util, configuration
7
+ from GameSentenceMiner.configuration import *
8
+ from GameSentenceMiner.model import *
9
9
 
10
10
  client: obsws = None
11
11
 
@@ -33,15 +33,7 @@ def start_obs():
33
33
 
34
34
 
35
35
  def get_obs_websocket_config_values():
36
- if platform == "win32":
37
- config_path = os.path.expanduser(r"~\AppData\Roaming\obs-studio\plugin_config\obs-websocket\config.json")
38
- elif platform == "darwin": # macOS
39
- config_path = os.path.expanduser(
40
- "~/Library/Application Support/obs-studio/plugin_config/obs-websocket/config.json")
41
- elif platform == "linux":
42
- config_path = os.path.expanduser("~/.config/obs-studio/plugin_config/obs-websocket/config.json")
43
- else:
44
- raise Exception("Unsupported operating system.")
36
+ config_path = os.path.join(get_app_directory(), 'obs-studio', 'config', 'obs-studio', 'plugin_config', 'obs-websocket', 'config.json')
45
37
 
46
38
  # Check if config file exists
47
39
  if not os.path.isfile(config_path):
@@ -5,7 +5,7 @@ import sys
5
5
  import pyperclip
6
6
  import requests
7
7
 
8
- from src.configuration import logger, get_app_directory
8
+ from GameSentenceMiner.configuration import logger, get_app_directory
9
9
 
10
10
  PACKAGE_NAME = "GameSentenceMiner"
11
11
  VERSION_FILE_PATH = os.path.join(get_app_directory(), 'version.txt')
@@ -9,7 +9,7 @@ from sys import platform
9
9
 
10
10
  from rapidfuzz import process
11
11
 
12
- from src.configuration import logger
12
+ from GameSentenceMiner.configuration import logger
13
13
 
14
14
  SCRIPTS_DIR = r"E:\Japanese Stuff\agent-v0.1.4-win32-x64\data\scripts"
15
15
 
@@ -102,6 +102,7 @@ def find_script_for_game(game_title):
102
102
 
103
103
  best_script, matched_game_name, confidence = find_most_similar_script(game_title, steam_scripts)
104
104
 
105
+
105
106
  if best_script:
106
107
  logger.info(f"Found Script: {best_script}")
107
108
  return best_script
@@ -2,8 +2,8 @@ import tempfile
2
2
 
3
3
  from silero_vad import load_silero_vad, read_audio, get_speech_timestamps
4
4
 
5
- from src import configuration, ffmpeg
6
- from src.configuration import *
5
+ from GameSentenceMiner import configuration, ffmpeg
6
+ from GameSentenceMiner.configuration import *
7
7
 
8
8
  # Silero VAD setup
9
9
  vad_model = load_silero_vad()
@@ -7,8 +7,8 @@ import requests
7
7
  import soundfile as sf
8
8
  import vosk
9
9
 
10
- from src import configuration, ffmpeg
11
- from src.configuration import *
10
+ from GameSentenceMiner import configuration, ffmpeg
11
+ from GameSentenceMiner.configuration import *
12
12
 
13
13
  ffmpeg_base_command_list = ["ffmpeg", "-hide_banner", "-loglevel", "error"]
14
14
  vosk.SetLogLevel(-1)
@@ -4,8 +4,8 @@ import warnings
4
4
  import stable_whisper as whisper
5
5
  from stable_whisper import WhisperResult
6
6
 
7
- from src import configuration, ffmpeg
8
- from src.configuration import *
7
+ from GameSentenceMiner import configuration, ffmpeg
8
+ from GameSentenceMiner.configuration import *
9
9
 
10
10
  ffmpeg_base_command_list = ["ffmpeg", "-hide_banner", "-loglevel", "error"]
11
11
  whisper_model = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: GameSentenceMiner
3
- Version: 2.2.1
3
+ Version: 2.2.2.post1
4
4
  Summary: A tool for mining sentences from games. Update: Use ffprobe from GSM Directory
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -30,7 +30,7 @@ Requires-Dist: ttkbootstrap~=1.10.1
30
30
  Requires-Dist: dataclasses_json~=0.6.7
31
31
  Requires-Dist: numpy
32
32
  Requires-Dist: pystray
33
- Requires-Dist: pywin32
33
+ Requires-Dist: pywin32; sys_platform == "win32"
34
34
 
35
35
  # Game Sentence Miner
36
36
 
@@ -43,6 +43,17 @@ Short Demo (Watch this first): https://www.youtube.com/watch?v=J2At52oWieU
43
43
 
44
44
  Installation: https://www.youtube.com/watch?v=b-L4g9tA508
45
45
 
46
+ ## How Does it Work?
47
+
48
+ 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.
49
+
50
+ 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).
51
+ 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))
52
+
53
+ That's it.
54
+
55
+ 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.
56
+
46
57
  ## Features:
47
58
 
48
59
  - **OBS Replay Buffer**: Constantly records the last X seconds of gameplay.
@@ -0,0 +1,24 @@
1
+ GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ GameSentenceMiner/anki.py,sha256=_yaHQZwOYooQssfJ5hbST5cC6vsffkSEvUIeMouwQZw,9208
3
+ GameSentenceMiner/config_gui.py,sha256=d9bQUUI-QR879FJJsROcQ4Y7gk08h95uPNGN1DWdIuU,49005
4
+ GameSentenceMiner/configuration.py,sha256=Cw5vUF74ZKcSinbciNMiLKpMO8M6sf-0THokHO_31nE,14010
5
+ GameSentenceMiner/ffmpeg.py,sha256=txTpco-IGWtfF8vIiWUzrtgI5TA1xPVIK-WJWxU02mM,10878
6
+ GameSentenceMiner/gametext.py,sha256=pAovclbBSLigoyJMcdhNrieFDDPLJY3htHBGhjQ2Xk0,4081
7
+ GameSentenceMiner/gsm.py,sha256=6LX3kFhyB1QoXFr5jzGZvONzQa6_PmPn_R7o2AiRRqA,16493
8
+ GameSentenceMiner/model.py,sha256=oh8VVT8T1UKekbmP6MGNgQ8jIuQ_7Rg4GPzDCn2kJo8,1999
9
+ GameSentenceMiner/notification.py,sha256=WBaQWoPNhW4XqdPBUmxPBgjk0ngzH_4v9zMQ-XQAKC8,2010
10
+ GameSentenceMiner/obs.py,sha256=8q0a17jJuaAlgkg0EHeCCCNdGlsxfg5TPB-sjPJNksk,6197
11
+ GameSentenceMiner/package_updater.py,sha256=KBJwLrlcAyoGHNNmDSVdPgWawqfWiIWOodcZhYheoms,1486
12
+ GameSentenceMiner/util.py,sha256=cgKpPfRpouWI6tjE_35MWp8nXqRzXs3LvsYXWm5_DOg,4584
13
+ GameSentenceMiner/downloader/Untitled_json.py,sha256=RUUl2bbbCpUDUUS0fP0tdvf5FngZ7ILdA_J5TFYAXUQ,15272
14
+ GameSentenceMiner/downloader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ GameSentenceMiner/downloader/download_tools.py,sha256=M7vLo6_0QMuk1Ji4CsZqk1C2g7Bq6PyM29r7XNoP6Rw,6406
16
+ GameSentenceMiner/vad/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ GameSentenceMiner/vad/silero_trim.py,sha256=syDJX_KbFmdyFFtnQqYTD0tICsUCJizYhs-atPgXtxA,1549
18
+ GameSentenceMiner/vad/vosk_helper.py,sha256=-AAwK0cgOC5rK3_gL0sQgrPJ75E49g_PxZR4d5ckwc4,5826
19
+ GameSentenceMiner/vad/whisper_helper.py,sha256=bpR1HVnJRn9H5u8XaHBqBJ6JwIjzqn-Fajps8QmQ4zc,3411
20
+ GameSentenceMiner-2.2.2.post1.dist-info/METADATA,sha256=grrT_Td6jB9w3pRoOw91noJFMxUup9tzdRgntlRd1uU,10131
21
+ GameSentenceMiner-2.2.2.post1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
22
+ GameSentenceMiner-2.2.2.post1.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
23
+ GameSentenceMiner-2.2.2.post1.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
24
+ GameSentenceMiner-2.2.2.post1.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ gamesentenceminer = GameSentenceMiner.gsm:main
@@ -0,0 +1 @@
1
+ GameSentenceMiner
@@ -1,24 +0,0 @@
1
- src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- src/anki.py,sha256=FfOxvozC4LBzhexiyY_uDSH3wgxzf4Uqvf8DZyyGlsQ,9138
3
- src/config_gui.py,sha256=oY397FO5WYHluPNOtfed3Eakw3TMpVStCaoEU60jw00,48963
4
- src/configuration.py,sha256=Cw5vUF74ZKcSinbciNMiLKpMO8M6sf-0THokHO_31nE,14010
5
- src/ffmpeg.py,sha256=-P0ysDrBefYpu8JOV6-tu52zqg2wDMwVqSVeO5iFQxc,10836
6
- src/gametext.py,sha256=EGFGzNrkLX_YdUWbksE7bf_4P7O-zcbdhsgubpUt5xw,4025
7
- src/gsm.py,sha256=DTVkA-MxFq3zsxH1wl1TJPz-sQIrjZdxCtzMsE9YYW0,16250
8
- src/model.py,sha256=oh8VVT8T1UKekbmP6MGNgQ8jIuQ_7Rg4GPzDCn2kJo8,1999
9
- src/notification.py,sha256=4lteRvzizUb081t_87DpophOQceBnNerNq3ppq5POH8,1996
10
- src/obs.py,sha256=SAP-_JB-37ZjZIbpWs9-MYPJHtT0BpKLD-KQuvneHtg,6538
11
- src/package_updater.py,sha256=Yel-KWBHr5kgIJpHM1A1w5tcx_gDqrLrK0pqXRhinlI,1472
12
- src/util.py,sha256=QRJMSEtnLaT4c2avQ0gZNn1oPtDfBbqcE8zuFHTzbd8,4569
13
- src/downloader/Untitled_json.py,sha256=RUUl2bbbCpUDUUS0fP0tdvf5FngZ7ILdA_J5TFYAXUQ,15272
14
- src/downloader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- src/downloader/download_tools.py,sha256=m1UV8EvWJdNn2cz11BCUI2mth46RhbVdVHXYYC318V8,6378
16
- src/vad/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- src/vad/silero_trim.py,sha256=rcHzSNjAm_liiKBWsdywpIC1oUrM00I7kxmomXCQ-Io,1521
18
- src/vad/vosk_helper.py,sha256=4oaI7uesINu1sO7PA0-M4qSOmiEneRRN4Ae8ztmYCBE,5798
19
- src/vad/whisper_helper.py,sha256=N8-FZMIjLb5CiFeyY8pz050v7RguU39B6tnvsPTbSmc,3383
20
- GameSentenceMiner-2.2.1.dist-info/METADATA,sha256=QZzBzJ6OpsODRoGaY52g3VQOQEfhKLhrlsmNmdKpVqs,9157
21
- GameSentenceMiner-2.2.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
22
- GameSentenceMiner-2.2.1.dist-info/entry_points.txt,sha256=hzWrryQzGBdqbVqzUIBbVZvvh7MBTUYvWiIs95QrfHE,51
23
- GameSentenceMiner-2.2.1.dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4
24
- GameSentenceMiner-2.2.1.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- gamesentenceminer = src.gsm:main
@@ -1 +0,0 @@
1
- src
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes