pack the client audio processing into its own chain
This commit is contained in:
@ -12,7 +12,6 @@ class Am(Chain):
|
||||
AmDemod(),
|
||||
DcBlock(),
|
||||
agc,
|
||||
Convert(Format.FLOAT, Format.SHORT),
|
||||
]
|
||||
|
||||
super().__init__(*workers)
|
||||
|
14
csdr/chain/clientaudio.py
Normal file
14
csdr/chain/clientaudio.py
Normal file
@ -0,0 +1,14 @@
|
||||
from csdr.chain import Chain
|
||||
from pycsdr.modules import AudioResampler, Convert, AdpcmEncoder
|
||||
from pycsdr.types import Format
|
||||
|
||||
|
||||
class ClientAudioChain(Chain):
|
||||
def __init__(self, inputRate: int, clientRate: int, compression: str):
|
||||
workers = []
|
||||
if inputRate != clientRate:
|
||||
workers += [AudioResampler(inputRate, clientRate)]
|
||||
workers += [Convert(Format.FLOAT, Format.SHORT)]
|
||||
if compression == "adpcm":
|
||||
workers += [AdpcmEncoder()]
|
||||
super().__init__(*workers)
|
@ -13,6 +13,5 @@ class Fm(Chain):
|
||||
Limit(),
|
||||
NfmDeemphasis(sampleRate),
|
||||
agc,
|
||||
Convert(Format.FLOAT, Format.SHORT),
|
||||
]
|
||||
super().__init__(*workers)
|
||||
|
@ -10,7 +10,6 @@ class Ssb(Chain):
|
||||
# empty chain as placeholder for the "last decimation"
|
||||
Chain(),
|
||||
Agc(Format.FLOAT),
|
||||
Convert(Format.FLOAT, Format.SHORT),
|
||||
]
|
||||
super().__init__(*workers)
|
||||
|
||||
|
Reference in New Issue
Block a user