简体   繁体   English

如何使用Python在我的声卡上播放FM解调信号

[英]How to play an FM demodulated signal on my sound card in Python

I have an array that has an FM demodulated audio signal. 我有一个具有FM解调音频信号的阵列。 I want to play this array on the sound card. 我想在声卡上播放此阵列。

What should I do? 我该怎么办?

You can start with this link: https://wiki.python.org/moin/PythonInMusic 您可以从以下链接开始: https : //wiki.python.org/moin/PythonInMusic

The section on Audio Programming frameworks and Playing and Creating Sound might be of interest to you 您可能会对“ Audio Programming frameworks以及Playing and Creating Sound部分感兴趣

Take a look at this pygame project: 看一下这个pygame项目:

http://www.pygame.org/project-pitch+perfect-1689-2941.html http://www.pygame.org/project-pitch+perfect-1689-2941.html

Play musical notes on an object resembling a pitch pipe in real time 实时在类似音高管的对象上播放音符

Download link: http://code.google.com/p/pitch-perfect/ 下载链接: http : //code.google.com/p/pitch-perfect/

In the source, they build a numpy array with a tone (eg sine wave, square wave etc) and send it to the SDL mixer. 在源代码中,他们构建一个带有音调的numpy数组(例如正弦波,方波等),并将其发送到SDL混合器。 At a cursory glance, I think it comes down to this line (in generate.py GenerateTone(shape='sine', freq=440.0, vol=1.0) ): 粗略地看一下,我认为它可以归结为这一行(在generate.py GenerateTone(shape='sine', freq=440.0, vol=1.0) ):

snd_ary = ary * vol * 127.0
return pg.sndarray.make_sound(snd_ary.astype(np.uint8) + 128)

It looks like this converts an array to a pygame sound. 看起来这将数组转换为pygame声音。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM