采样率: 22050 Hz声道数: 1时长: 6.04 秒格式: WAV子类型: FLOATimport soundfile as sf def get_audio_info_soundfile(audio_path): try: info sf.info(audio_path) print(f采样率: {info.samplerate} Hz) print(f声道数: {info.channels}) print(f时长: {info.duration:.2f} 秒) print(f格式: {info.format}) print(f子类型: {info.subtype}) # 可能是 FLOAT return info.samplerate except Exception as e: print(f读取失败: {e}) return None # 安装: pip install soundfile sample_rate get_audio_info_soundfile(rD:\data\audios\post_0.wav)