32 lines
714 B
Python
32 lines
714 B
Python
#from rtlsdr.rtlsdrtcp.client import RtlSdrTcpClient
|
|
import asyncio
|
|
from rtlsdr import RtlSdr
|
|
from bfm_demod import BfmDemod
|
|
from gfsk_demod import GFSKDemod
|
|
import sounddevice as sd
|
|
import numpy as np
|
|
|
|
|
|
def main():
|
|
#sdr = RtlSdrTcpClient(hostname='localhost', port=12345)
|
|
sdr = RtlSdr()
|
|
|
|
sdr.set_sample_rate(2.048E6)
|
|
sdr.set_center_freq(434.55E6)
|
|
sdr.set_freq_correction(60)
|
|
sdr.set_gain("auto")
|
|
|
|
stream = sd.OutputStream(samplerate=48E3, dtype=np.float32, channels=1)
|
|
|
|
sink = GFSKDemod(sdr=sdr)
|
|
#sink = BfmDemod(sdr=sdr, stream=stream)
|
|
|
|
loop = asyncio.get_event_loop()
|
|
loop.run_until_complete(sink.start())
|
|
|
|
sdr.close()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|