summaryrefslogtreecommitdiff
path: root/gnuradio-examples/python/apps/hf_radio/output.py
blob: dc9caf5288b7b9b922e28b04ddc885bfadc4f9b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Audio output with a volume control.
#
# M. Revnell 2005-Dec

from gnuradio import gr, gru
from gnuradio import audio

class output( gr.hier_block ):
    def __init__( self, fg, rate ):
        self.out = audio.sink( rate )
        self.vol = gr.multiply_const_ff( 0.1 )
        fg.connect( self.vol, self.out )
        gr.hier_block.__init__(self, fg, self.vol, None )

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