diff options
Diffstat (limited to 'gnuradio-examples/python/digital_voice')
-rwxr-xr-x | gnuradio-examples/python/digital_voice/cvsd_test.py | 18 | ||||
-rwxr-xr-x | gnuradio-examples/python/digital_voice/encdec.py | 12 |
2 files changed, 13 insertions, 17 deletions
diff --git a/gnuradio-examples/python/digital_voice/cvsd_test.py b/gnuradio-examples/python/digital_voice/cvsd_test.py index 843201d6e5..f8f1b9cce6 100755 --- a/gnuradio-examples/python/digital_voice/cvsd_test.py +++ b/gnuradio-examples/python/digital_voice/cvsd_test.py @@ -20,7 +20,7 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, blks +from gnuradio import gr, blks2 from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -41,25 +41,21 @@ def main(): parser.print_help() raise SystemExit, 1 - fg = gr.flow_graph() + tb = gr.top_block() src = audio.source(int(options.sample_rate), options.audio_input) - tx = blks.cvsd_encode(fg, options.resample_rate) + tx = blks2.cvsd_encode(options.resample_rate) # todo: add noise - rx = blks.cvsd_decode(fg, options.resample_rate) + rx = blks2.cvsd_decode(options.resample_rate) dst = audio.sink(int(options.sample_rate), options.audio_output) - fg.connect(src, tx, rx, dst) + tb.connect(src, tx, rx, dst) + tb.run() - fg.start() - - raw_input ('Press Enter to exit: ') - fg.stop() - - if __name__ == '__main__': + print "Enter CTRL-C to exit" try: main() except KeyboardInterrupt: diff --git a/gnuradio-examples/python/digital_voice/encdec.py b/gnuradio-examples/python/digital_voice/encdec.py index a2e9d1e49f..e87d57e2b9 100755 --- a/gnuradio-examples/python/digital_voice/encdec.py +++ b/gnuradio-examples/python/digital_voice/encdec.py @@ -20,15 +20,15 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, blks +from gnuradio import gr, blks2 from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser -class my_graph(gr.flow_graph): +class my_top_block(gr.top_block): def __init__(self): - gr.flow_graph.__init__(self) + gr.top_block.__init__(self) parser = OptionParser(option_class=eng_option) parser.add_option("-I", "--audio-input", type="string", default="", @@ -42,10 +42,10 @@ class my_graph(gr.flow_graph): sample_rate = 8000 src = audio.source(sample_rate, options.audio_input) - tx = blks.digital_voice_tx(self) + tx = blks2.digital_voice_tx(self) if_gain = gr.multiply_const_cc(10000) # channel simulator here... - rx = blks.digital_voice_rx(self) + rx = blks2.digital_voice_rx(self) dst = audio.sink(sample_rate, options.audio_output) self.connect(src, tx, if_gain, rx, dst) @@ -53,6 +53,6 @@ class my_graph(gr.flow_graph): if __name__ == '__main__': try: - my_graph().run() + my_top_block().run() except KeyboardInterrupt: pass |