summaryrefslogtreecommitdiff
path: root/gr-uhd/apps/hf_radio/output.py
blob: 251d863bcb6e256364b101dd8a10baec2b6ce980 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Audio output with a volume control.
#
# M. Revnell 2005-Dec

from gnuradio import gr, gru
from gnuradio import audio

class output( gr.hier_block2 ):
    def __init__( self, rate, device ):
        gr.hier_block2.__init__(self, "output",
                                gr.io_signature(1,1,gr.sizeof_float),
                                gr.io_signature(0,0,0))
        
        self.vol = gr.multiply_const_ff( 0.1 )
        self.out = audio.sink( int(rate), device )

        self.connect( self, self.vol, self.out )

    def set( self, val ):
        self.vol.set_k( val )