summaryrefslogtreecommitdiff
path: root/fm.py
diff options
context:
space:
mode:
Diffstat (limited to 'fm.py')
-rw-r--r--fm.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/fm.py b/fm.py
new file mode 100644
index 0000000..2a1d8be
--- /dev/null
+++ b/fm.py
@@ -0,0 +1,24 @@
+import asyncio
+from rtlsdr import RtlSdr
+
+RATE_IN = RATE_OUT = 170000
+RATE_OUT2 = 32000
+CUSTOM_ATAN = 1
+DEEMPH = 1
+SQUELCH = 0
+
+async def streaming():
+ sdr = RtlSdr()
+
+ async for samples in sdr.stream():
+ # do something with samples
+ # ...
+
+ # to stop streaming:
+ await sdr.stop()
+
+ # done
+ sdr.close()
+
+loop = asyncio.get_event_loop()
+loop.run_until_complete(streaming())