I can't get ipython console to play a sound in spyder
Asked Answered
T

1

6

I've been trying to play audio files (.wav) using IPython but I don't hear any sound.

What do I do to hear the actual sound?

Here is the code:

import IPython
IPython.display.Audio("180960__kleeb__gunshot.wav")

I expect to hear a sound but I only get this result:

Out[46]: <IPython.lib.display.Audio object>.
Toilette answered 7/7, 2019 at 21:7 Comment(4)
All I get is: Out[46]: <IPython.lib.display.Audio object>.Toilette
I have also tried the wave.make_audio() and I get the same resultToilette
(Spyder maintainer here) Our IPython console can't handle this type of content, sorry.Outside
Alternatives to IPython.display.Audio used in Jupyter: Playing and Recording Sound in Python. I use python-sounddevice. It depends on PortAudio and can be installed with conda directly (conda-forge), without using Windows pre-built versions mentioned in the documentation.Murry
T
4

You need a front-end notebook that can support those widgets. I don't think you can do it with IPython interactive shell.

The IPython Notebook is now known as the Jupyter Notebook.

Tried with Jupyter notebook and it works perfectly: enter image description here

If you want to try out Jupyter, you can do it here.

Tallu answered 8/7, 2019 at 8:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.