python的实时音频传送_使用PyAudio和Numpy在Python中进行实时音频分析

这是一个使用PyAudio和Numpy进行实时音频分析的简单Python包。它从任何源(如声卡、麦克风)获取音频数据,以高频率更新并存储在FIFO缓冲区中。通过调用.get_audio_features()应用快速傅里叶变换,并在启用可视化时使用PyGame GUI实时显示FFT特征。该代码已在Ubuntu 18.04上测试,但可能需要在其他平台上解决音频和显示问题。计划实现包括实时节拍检测和旋律提取功能。
摘要由CSDN通过智能技术生成

Realtime_PyAudio_FFT

A simple package to do realtime audio analysis in native Python, using PyAudio and Numpy to extract and visualize FFT features from a live audio stream.

The basic pipeline:

Starts a stream_reader that pulls live audio data from any source using PyAudio (soundcard, microphone, ...)

Reads data from this stream many times per second (eg 1000 updates per second) and stores that data in a fifo buffer

When triggered by .get_audio_features(), the stream_analyzer, applies a Fast-Fourier-Transform to the most recent audio window in the buffer

When visualize is enabled, the visualizer displays these FFT features in realtime using a PyGame GUI (I made two display modes: 2D and 3D)

Requirements:

pip install -r requirements.txt

If you're having trouble installing PyAudio, you might want to sudo apt install libasoun

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值