LoginSignup
0
0

More than 1 year has passed since last update.

Pythonでの音声信号処理 (2) 読み込んだ情報を可視化する

Last updated at Posted at 2023-01-08

やりたいこと

ファイルから読み込んだ音声データを見える化すること。

やってみる

ファイルから読み込んで、表示してみる。

p2.py
from pydub import AudioSegment
import numpy as np
import matplotlib.pyplot as plt


def main():
    dt_raw = AudioSegment.from_mp3("data.mp3")
    dt_arr = np.array(dt_raw.get_array_of_samples())

    ch1_y = dt_arr[::2]
    ch1_x = np.arange(len(ch1_y))

    plt.plot(ch1_x, ch1_y)
    plt.show()


if __name__ == '__main__':

    main()

実行結果
P02.png

詰まっていて詳細が見づらいので、次回以降、修正(予定)。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0