LoginSignup
0
2

More than 3 years have passed since last update.

pythonでgnuradio その4

Posted at

概要

pythonでgnuradioやってみた。
サイン波を再生。

サンプルコード

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




以上。

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2