diff options
Diffstat (limited to 'docs/exploring-gnuradio/dial_tone_example.xml')
-rw-r--r-- | docs/exploring-gnuradio/dial_tone_example.xml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/exploring-gnuradio/dial_tone_example.xml b/docs/exploring-gnuradio/dial_tone_example.xml new file mode 100644 index 000000000..14ea68039 --- /dev/null +++ b/docs/exploring-gnuradio/dial_tone_example.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<example id="dial_tone_ex"><title>Dial Tone Output</title> +<programlisting> +#!/usr/bin/env python + +from gnuradio import gr +from gnuradio import audio + +def build_graph (): + sampling_freq = 48000 + ampl = 0.1 + + fg = gr.flow_graph () + src0 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, 350, ampl) + src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, 440, ampl) + dst = audio.sink (sampling_freq) + fg.connect ((src0, 0), (dst, 0)) + fg.connect ((src1, 0), (dst, 1)) + + return fg + +if __name__ == '__main__': + fg = build_graph () + fg.start () + raw_input ('Press Enter to quit: ') + fg.stop () +</programlisting> +</example> |