可视化声波

Python 语音语言处理

Daniel Bourke

Machine Learning Engineer/YouTube Creator

添加另一条声波

  • 新音频文件:good_afternoon.wav
  • 二者均为 48 kHz
  • 对所有音频文件应用相同的数据变换
Python 语音语言处理

设置绘图

import matplotlib.pyplot as plt

# Initialize figure and setup title plt.title("Good Afternoon vs. Good Morning")
# x and y axis labels plt.xlabel("Time (seconds)") plt.ylabel("Amplitude")
# Add good morning and good afternoon values plt.plot(time_ga, soundwave_ga, label ="Good Afternoon") plt.plot(time_gm, soundwave_gm, label="Good Morning", alpha=0.5)
# Create a legend and show our plot plt.legend() plt.show()
Python 语音语言处理

早安声波与午安声波对比

Python 语音语言处理

开始可视化!

Python 语音语言处理

Preparing Video For Download...