#概要
pythonでgnuradioやってみた。
サイン波を録音。
#サンプルコード
from gnuradio import gr
from gnuradio import blocks
from gnuradio import analog
class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
samples = sample_rate = 48000
ampl = 0.3
src = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 440, ampl)
head = blocks.head(gr.sizeof_float, samples)
dst = blocks.wavfile_sink("a1.wav", 1, sample_rate, 8)
self.connect(src, head, (dst, 0))
if __name__ == '__main__':
try:
my_top_block().run()
except KeyboardInterrupt:
pass
以上。