概要
pythonでgnuradioやってみた。
練習問題やってみた。
練習問題
sin波を再生せよ。
サンプルコード
from gnuradio import analog, audio, blocks, gr
class my_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self, "top0")
self.samp_rate = samp_rate = 48000
self.audio_sink_0 = audio.sink(samp_rate, '', True)
self.wavfile_source_0 = blocks.wavfile_source("a1.wav", True)
self.connect((self.wavfile_source_0, 0), (self.audio_sink_0, 0))
if __name__ == '__main__':
try:
my_block().run()
except KeyboardInterrupt:
pass
以上。