Initial pass at getting all the scripts and menus working with the new everything in home setup. Also unify speech settings. Not sure why I thought separate speech settings for all menus was a good idea lol.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import curses
|
||||
import configparser
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
@@ -10,6 +9,7 @@ import subprocess
|
||||
import sys
|
||||
import time
|
||||
from dataclasses import dataclass
|
||||
from stormux_speech_settings import load_speech_settings
|
||||
|
||||
try:
|
||||
import simpleaudio as sa
|
||||
@@ -257,9 +257,6 @@ class AudioManagerApp:
|
||||
self.backend = AudioBackend()
|
||||
self.feedback = AudioFeedback()
|
||||
self.speech_client = None
|
||||
self.config_dir = os.path.expanduser("~/.config/stormux")
|
||||
self.config_file = os.path.join(self.config_dir, "game_launcher.conf")
|
||||
self.config = configparser.ConfigParser()
|
||||
self.speech_rate = 0
|
||||
self.speech_pitch = 0
|
||||
self.stdscr = None
|
||||
@@ -285,16 +282,9 @@ class AudioManagerApp:
|
||||
self.load_speech_settings()
|
||||
|
||||
def load_speech_settings(self):
|
||||
if not os.path.exists(self.config_file):
|
||||
return
|
||||
|
||||
try:
|
||||
self.config.read(self.config_file)
|
||||
if "Speech" in self.config:
|
||||
self.speech_rate = self.config.getint("Speech", "rate", fallback=0)
|
||||
self.speech_pitch = self.config.getint("Speech", "pitch", fallback=0)
|
||||
except Exception:
|
||||
pass
|
||||
speech_settings = load_speech_settings()
|
||||
self.speech_rate = speech_settings.rate
|
||||
self.speech_pitch = speech_settings.pitch
|
||||
|
||||
def init_speech(self):
|
||||
if speechd is None:
|
||||
|
||||
Reference in New Issue
Block a user