IPython display Audio and ProgressBar
Ejecutar el sonido de un audio y visualizar una barra de progreso durante el procesamiento de elementos
!pip install -U ipython
from IPython.display import clear_output
clear_output()
print("Restart the runtime!")
from urllib.request import urlopen
from IPython.display import Audio, ProgressBar
sound_file=('https://raw.githubusercontent.com/oleksis/'
'jupyter/master/assets/sounds/complete.wav')
sound_local = 'temp_sound.wav'
#Save Sound local
with urlopen(sound_file) as f_in, open(sound_local, 'wb') as f_out:
f_out.write(f_in.read())
pb = ProgressBar(1000)
for i, _ in enumerate(pb, 1):
print("\r",
"Processing %d element%s" % (i, "s" if i > 1 else "" ),
sep="",
end="",
flush=True)
Audio(sound_local, autoplay=True)