Advertisement
Guest User

Untitled

a guest
Feb 18th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. def _start(self):
  2. if self.config['source'] == 'pulse':
  3. proc_mm = subprocess.Popen(
  4. ['multimon-ng', '-a', 'AFSK1200', '-A', '-t', 'raw', '/dev/stdin'],
  5. stdout=subprocess.PIPE, stderr=open('/dev/null')
  6. )
  7. else:
  8. if self.config['source'] == 'rtl':
  9. proc_src = subprocess.Popen(
  10. ['rtl_fm', '-f', str(int(self.config['rtl']['freq'] * 1e6)), '-s', '22050',
  11. '-p', str(self.config['rtl']['ppm']), '-g', str(self.config['rtl']['gain']$
  12. stdout=subprocess.PIPE, stderr=open('/dev/null')
  13. )
  14. elif self.config['source'] == 'alsa':
  15. proc_src = subprocess.Popen(
  16. ['arecord', '-D', self.config['alsa']['device'],
  17. '-r', '22050', '-f', 'S16_LE', '-t', 'raw', '-c', '1', '-'],
  18. stdout=subprocess.PIPE, stderr=open('/dev/null')
  19. )
  20. proc_mm = subprocess.Popen(
  21. ['multimon-ng', '-a', 'AFSK1200', '-A', '-t', 'raw', '/dev/stdin', '-'],
  22. stdin=proc_src.stdout,
  23. stdout=subprocess.PIPE, stderr=open('/dev/null')
  24. )
  25. self.subprocs['src'] = proc_src
  26. self.subprocs['mm'] = proc_mm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement