視覺化音波

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...