diff options
Diffstat (limited to 'gr-audio/examples/python/mono_tone.py')
-rwxr-xr-x | gr-audio/examples/python/mono_tone.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gr-audio/examples/python/mono_tone.py b/gr-audio/examples/python/mono_tone.py index bce486e4ab..ad73d62327 100755 --- a/gr-audio/examples/python/mono_tone.py +++ b/gr-audio/examples/python/mono_tone.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005,2007 Free Software Foundation, Inc. +# Copyright 2004,2005,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,6 +25,12 @@ from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + #import os #print os.getpid() #raw_input('Attach gdb and press Enter: ') @@ -50,11 +56,11 @@ class my_top_block(gr.top_block): sample_rate = int(options.sample_rate) ampl = 0.1 - src0 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 650, ampl) + src0 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 650, ampl) - dst = audio.sink (sample_rate, - options.audio_output, - options.ok_to_block) + dst = audio.sink(sample_rate, + options.audio_output, + options.ok_to_block) self.connect (src0, (dst, 0)) |