mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
another alc level adjustment
This commit is contained in:
parent
021d6fd79a
commit
2c2c0bf6a3
2 changed files with 8 additions and 7 deletions
12
tnc/modem.py
12
tnc/modem.py
|
@ -544,21 +544,21 @@ class RF:
|
||||||
# Re-sample back up to 48k (resampler works on np.int16)
|
# Re-sample back up to 48k (resampler works on np.int16)
|
||||||
x = np.frombuffer(txbuffer, dtype=np.int16)
|
x = np.frombuffer(txbuffer, dtype=np.int16)
|
||||||
if static.AUDIO_AUTO_TUNE:
|
if static.AUDIO_AUTO_TUNE:
|
||||||
if static.HAMLIB_ALC == 0.0 and static.TX_AUDIO_LEVEL <= 10:
|
if static.HAMLIB_ALC == 0.0:
|
||||||
static.TX_AUDIO_LEVEL = 30
|
static.TX_AUDIO_LEVEL = static.TX_AUDIO_LEVEL + 30
|
||||||
elif 0.0 < static.HAMLIB_ALC <= 0.8:
|
elif 0.0 < static.HAMLIB_ALC <= 0.8:
|
||||||
print("0.001 > static.HAMLIB_ALC <= 0.8")
|
print("0.001 > static.HAMLIB_ALC <= 0.8")
|
||||||
static.TX_AUDIO_LEVEL = static.TX_AUDIO_LEVEL + 20
|
static.TX_AUDIO_LEVEL = static.TX_AUDIO_LEVEL + 20
|
||||||
self.log.debug("[MDM] AUDIO TUNE", level=str(static.TX_AUDIO_LEVEL), alc=str(static.HAMLIB_ALC))
|
self.log.debug("[MDM] AUDIO TUNE", audio_level=str(static.TX_AUDIO_LEVEL), alc_level=str(static.HAMLIB_ALC))
|
||||||
elif 0.8 < static.HAMLIB_ALC < 0.99:
|
elif 0.8 < static.HAMLIB_ALC < 0.99:
|
||||||
print("0.8 > static.HAMLIB_ALC <= 0.99")
|
print("0.8 > static.HAMLIB_ALC <= 0.99")
|
||||||
static.TX_AUDIO_LEVEL = static.TX_AUDIO_LEVEL + 2
|
static.TX_AUDIO_LEVEL = static.TX_AUDIO_LEVEL + 2
|
||||||
self.log.debug("[MDM] AUDIO TUNE", level=str(static.TX_AUDIO_LEVEL), alc=str(static.HAMLIB_ALC))
|
self.log.debug("[MDM] AUDIO TUNE", audio_level=str(static.TX_AUDIO_LEVEL), alc_level=str(static.HAMLIB_ALC))
|
||||||
elif 1.0 < static.HAMLIB_ALC:
|
elif 1.0 < static.HAMLIB_ALC:
|
||||||
static.TX_AUDIO_LEVEL = static.TX_AUDIO_LEVEL - 2
|
static.TX_AUDIO_LEVEL = static.TX_AUDIO_LEVEL - 2
|
||||||
self.log.debug("[MDM] AUDIO TUNE", level=str(static.TX_AUDIO_LEVEL), alc=str(static.HAMLIB_ALC))
|
self.log.debug("[MDM] AUDIO TUNE", audio_level=str(static.TX_AUDIO_LEVEL), alc_level=str(static.HAMLIB_ALC))
|
||||||
else:
|
else:
|
||||||
self.log.debug("[MDM] AUDIO TUNE", level=str(static.TX_AUDIO_LEVEL), alc=str(static.HAMLIB_ALC))
|
self.log.debug("[MDM] AUDIO TUNE", audio_level=str(static.TX_AUDIO_LEVEL), alc_level=str(static.HAMLIB_ALC))
|
||||||
x = set_audio_volume(x, static.TX_AUDIO_LEVEL)
|
x = set_audio_volume(x, static.TX_AUDIO_LEVEL)
|
||||||
|
|
||||||
txbuffer_48k = self.resampler.resample8_to_48(x)
|
txbuffer_48k = self.resampler.resample8_to_48(x)
|
||||||
|
|
|
@ -9,6 +9,7 @@ import socket
|
||||||
import time
|
import time
|
||||||
import structlog
|
import structlog
|
||||||
import threading
|
import threading
|
||||||
|
import static
|
||||||
|
|
||||||
# set global hamlib version
|
# set global hamlib version
|
||||||
hamlib_version = 0
|
hamlib_version = 0
|
||||||
|
@ -260,7 +261,7 @@ class radio:
|
||||||
if alc != 0.0:
|
if alc != 0.0:
|
||||||
self.alc = alc
|
self.alc = alc
|
||||||
else:
|
else:
|
||||||
self.alc = 0.0
|
self.alc = static.HAMLIB_ALC
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.alc = 0.0
|
self.alc = 0.0
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue