Improvements to Dectalk driver.
This commit is contained in:
@@ -4,5 +4,5 @@
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributors.
|
||||
|
||||
version = "2026.07.25"
|
||||
version = "2026.07.26"
|
||||
code_name = "testing"
|
||||
|
||||
@@ -10,16 +10,17 @@ from fenrirscreenreader.speechDriver.hardwareSerialDriver import (
|
||||
|
||||
|
||||
class driver(hardware_serial_driver):
|
||||
cancel_command = b"\x18"
|
||||
cancel_command = b"\x03"
|
||||
use_xon_xoff = True
|
||||
|
||||
def _speak_bytes(self, text):
|
||||
return self._clean_text(text).encode("ascii", errors="replace") + b"\x01"
|
||||
return self._clean_text(text).encode("ascii", errors="replace") + b"\x0b"
|
||||
|
||||
def _rate_command(self, rate):
|
||||
return self._setting_command("ra", self._scale(rate, 75, 650))
|
||||
|
||||
def _pitch_command(self, pitch):
|
||||
return self._setting_command("dv ap", self._scale(pitch, 50, 180))
|
||||
return self._setting_command("dv ap", self._scale(pitch, 50, 350))
|
||||
|
||||
def _volume_command(self, volume):
|
||||
return self._setting_command("vo", self._scale(volume, 0, 100))
|
||||
|
||||
@@ -27,6 +27,7 @@ class SpeakQueue(Queue):
|
||||
class hardware_serial_driver(speech_driver):
|
||||
cancel_command = b""
|
||||
default_baud_rate = 9600
|
||||
use_xon_xoff = False
|
||||
|
||||
def __init__(self):
|
||||
speech_driver.__init__(self)
|
||||
@@ -176,7 +177,11 @@ class hardware_serial_driver(speech_driver):
|
||||
attrs[5] = baud_rate
|
||||
attrs[6][termios.VMIN] = 0
|
||||
attrs[6][termios.VTIME] = 0
|
||||
attrs[0] &= ~(termios.IXON | termios.IXOFF | termios.IXANY)
|
||||
if self.use_xon_xoff:
|
||||
attrs[0] |= termios.IXON
|
||||
attrs[0] &= ~(termios.IXOFF | termios.IXANY)
|
||||
else:
|
||||
attrs[0] &= ~(termios.IXON | termios.IXOFF | termios.IXANY)
|
||||
termios.tcsetattr(port, termios.TCSANOW, attrs)
|
||||
return port
|
||||
except (OSError, termios.error) as error:
|
||||
|
||||
Reference in New Issue
Block a user