Python recording and plotting audio

To record and plot audio with Python, use Python's audio processing library and plotting library.

Here is a simple example code that demonstrates how to record audio and plot its waveform using Python:

import wave
import numpy as np
import matplotlib.pyplot as plt

# 设置音频参数
sample_rate = 44100  # 采样率
duration = 5  # 录制时长(秒)
frequency = 440  # 音频频率(Hz)
volume = 32767  

Guess you like

Origin blog.csdn.net/u011046042/article/details/135010331