mirror of
https://github.com/jketterl/openwebrx.git
synced 2025-12-31 21:59:58 +01:00
fix switching of secondary fft compression
This commit is contained in:
parent
90955819bf
commit
1971edf412
15
owrx/dsp.py
15
owrx/dsp.py
|
|
@ -366,7 +366,7 @@ class ClientDemodulatorChain(Chain):
|
|||
def getSecondaryFftOutputFormat(self) -> Format:
|
||||
if self.secondaryFftCompression == "adpcm":
|
||||
return Format.CHAR
|
||||
return Format.SHORT
|
||||
return Format.FLOAT
|
||||
|
||||
def setWfmDeemphasisTau(self, tau: float) -> None:
|
||||
if tau == self.wfmDeemphasisTau:
|
||||
|
|
@ -470,7 +470,7 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient)
|
|||
|
||||
self.subscriptions = [
|
||||
self.props.wireProperty("audio_compression", self.setAudioCompression),
|
||||
self.props.wireProperty("fft_compression", self.chain.setSecondaryFftCompression),
|
||||
self.props.wireProperty("fft_compression", self.setSecondaryFftCompression),
|
||||
self.props.wireProperty("fft_voverlap_factor", self.chain.setSecondaryFftOverlapFactor),
|
||||
self.props.wireProperty("fft_fps", self.chain.setSecondaryFftFps),
|
||||
self.props.wireProperty("digimodes_fft_size", self.setSecondaryFftSize),
|
||||
|
|
@ -617,6 +617,17 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient)
|
|||
self.chain.setWriter(buffer)
|
||||
self.wireOutput(self.audioOutput, buffer)
|
||||
|
||||
def setSecondaryFftCompression(self, compression):
|
||||
try:
|
||||
self.chain.setSecondaryFftCompression(compression)
|
||||
except ValueError:
|
||||
# wrong output format... need to re-wire
|
||||
pass
|
||||
|
||||
buffer = Buffer(self.chain.getSecondaryFftOutputFormat())
|
||||
self.chain.setSecondaryFftWriter(buffer)
|
||||
self.wireOutput("secondary_fft", buffer)
|
||||
|
||||
def start(self):
|
||||
if self.sdrSource.isAvailable():
|
||||
self.chain.setReader(self.sdrSource.getBuffer().getReader())
|
||||
|
|
|
|||
Loading…
Reference in a new issue