python处理声音的包:pygame,playsound
import wave import math import glob import matplotlib.pyplot as pl import pygame import time musicPath="D:\\12.wav" pygame.mixer.init()#初始化 pygame.init() track = pygame.mixer.music.load(musicPath)#加载音乐 pygame.mixer.music.play()#播放 while pygame.mixer.music.get_busy(): time.sleep(0.1)