IPython.display doesn't show long wav files

Question:

I use IPython.display for listening audio file in Jupyter notebook.
I have a long file(30 min).


import IPython.display as dis
import numpy
y = numpy.zeros(30*60*48000)

This code work as fluidly for 5 seconds

dis.display(dis.Audio(y[:5*48000], rate=48000))

but for 30 minutes the code hangs and there are no errors.

dis.display(dis.Audio(y, rate=48000))

Is this method not suitable for displaying long audios and is it limited?
Is there another way to display long files?

Answers:

You can use pydub library:

from pydub import AudioSegment
audio = AudioSegment.from_wav("your_audio.wav")
audio
Answered By: korovsky
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.