fix dial frequencies

This commit is contained in:
Jakob Ketterl
2021-08-31 22:46:11 +02:00
parent 120328ce12
commit 51453662e2
8 changed files with 83 additions and 33 deletions

View File

@@ -1,14 +1,18 @@
from csdr.chain.demodulator import SecondaryDemodulator, FixedAudioRateChain
from csdr.chain.demodulator import SecondaryDemodulator, FixedAudioRateChain, DialFrequencyReceiver
from owrx.audio.chopper import AudioChopper
from pycsdr.modules import Agc, Convert
from pycsdr.types import Format
class AudioChopperDemodulator(SecondaryDemodulator, FixedAudioRateChain):
class AudioChopperDemodulator(SecondaryDemodulator, FixedAudioRateChain, DialFrequencyReceiver):
# TODO parser typing
def __init__(self, mode: str, parser):
workers = [Convert(Format.FLOAT, Format.SHORT), AudioChopper(mode, parser)]
self.chopper = AudioChopper(mode, parser)
workers = [Convert(Format.FLOAT, Format.SHORT), self.chopper]
super().__init__(workers)
def getFixedAudioRate(self):
return 12000
def setDialFrequency(self, frequency: int) -> None:
self.chopper.setDialFrequency(frequency)