How to generate audio from a numpy array?

后端 未结 8 894
囚心锁ツ
囚心锁ツ 2020-11-28 04:09

I want to create \"heart rate monitor\" effect from a 2D array in numpy and want the tone to reflect the values in the array.

8条回答
  •  时光取名叫无心
    2020-11-28 05:03

    If you are using Jupyter, the best option is:

    from IPython.display import Audio
    Audio(numpy.sin(numpy.linspace(0, 3000, 20000)), rate=20000)
    

提交回复
热议问题