commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r4291 - gnuradio/branches/developers/trondeau/ethernet


From: trondeau
Subject: [Commit-gnuradio] r4291 - gnuradio/branches/developers/trondeau/ethernet/gnuradio-examples/python/hier/networking
Date: Thu, 18 Jan 2007 07:35:07 -0700 (MST)

Author: trondeau
Date: 2007-01-18 07:35:07 -0700 (Thu, 18 Jan 2007)
New Revision: 4291

Modified:
   
gnuradio/branches/developers/trondeau/ethernet/gnuradio-examples/python/hier/networking/dial_tone_sink.py
Log:
added sample rate option

Modified: 
gnuradio/branches/developers/trondeau/ethernet/gnuradio-examples/python/hier/networking/dial_tone_sink.py
===================================================================
--- 
gnuradio/branches/developers/trondeau/ethernet/gnuradio-examples/python/hier/networking/dial_tone_sink.py
   2007-01-18 14:34:43 UTC (rev 4290)
+++ 
gnuradio/branches/developers/trondeau/ethernet/gnuradio-examples/python/hier/networking/dial_tone_sink.py
   2007-01-18 14:35:07 UTC (rev 4291)
@@ -25,7 +25,7 @@
 from optparse import OptionParser
 
 class dial_tone_sink(gr.hier_block2):
-    def __init__(self, local_ipaddress, port, mtu):
+    def __init__(self, local_ipaddress, port, mtu, sample_rate):
         gr.hier_block2.__init__(self, 
                                 "dial_tone_sink",      # Block type 
                                 gr.io_signature(0,0,0), # Input signature
@@ -35,12 +35,9 @@
         self.define_component("src",  gr.udp_source(gr.sizeof_float,
                                                     local_ipaddress, port,
                                                     mtu))
-        sample_rate = 32000
         self.define_component("dst",  audio.sink(sample_rate))
-        self.define_component("dst2", gr.file_sink(gr.sizeof_float, 
"received.dat"))
 
         self.connect("src", 0, "dst", 0)       
-        self.connect("src", 0, "dst2", 0)      
         
 if __name__ == '__main__':
     parser = OptionParser(option_class=eng_option)
@@ -50,6 +47,8 @@
                       help="port value to listen to for connection")
     parser.add_option("", "--mtu", type="int", default=540,
                      help="packet size.")
+    parser.add_option("-r", "--sample-rate", type="int", default=8000,
+                      help="audio signal sample rate [default=%default]")
     (options, args) = parser.parse_args()
     if len(args) != 0:
         parser.print_help()
@@ -57,7 +56,7 @@
 
     # Create an instance of a hierarchical block
     top_block = dial_tone_sink(options.local_ipaddr, options.local_port,
-                               options.mtu)
+                               options.mtu, options.sample_rate)
     
     # Create an instance of a runtime, passing it the top block
     runtime = gr.runtime(top_block)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]