This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 命令行工具:读取 WAV 文件并绘制时域和频域图(全部注释为中文,包含详细说明)。 | |
| 使用示例: | |
| python voice.py --file /path/to/file.wav | |
| python voice.py --file /path/to/file.wav --fft-size 4096 --duration 3.5 | |
| 脚本要点: | |
| - 自动将立体声(多通道)合成单声道(求平均),方便统一分析。 | |
| - 将整数 PCM 数据归一化到 [-1, 1] 的浮点数,避免不同位深比较时量纲不一致。 |