title: Playing Audio From Numpy Array tags: python numpy ipython audio ## Play a Sine Wave Example from [this stackoverflow](https://stackoverflow.com/questions/10357992/how-to-generate-audio-from-a-numpy-array). ```py import numpy from IPython.display import Audio wave_audio = numpy.sin(numpy.linspace(0, 3000, 20000)) Audio(wave_audio, rate=20000) ``` Results in: ![IPython audio player]{cs}(2024-05-10_17-59-40.png)