简体   繁体   English

我无法让 ipython 控制台在 spyder 中播放声音

[英]I can't get ipython console to play a sound in spyder

I've been trying to play audio files (.wav) using IPython but I don't hear any sound.我一直在尝试使用 IPython 播放音频文件 (.wav),但我听不到任何声音。

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>.

You need a front-end notebook that can support those widgets.您需要一个可以支持这些小部件的前端笔记本。 I don't think you can do it with IPython interactive shell.我不认为你可以用 IPython 交互式 shell 来做到这一点。

The IPython Notebook is now known as the Jupyter Notebook. IPython Notebook 现在被称为 Jupyter Notebook。

Tried with Jupyter notebook and it works perfectly:用 Jupyter notebook 尝试过,效果很好: 在此处输入图片说明

If you want to try out Jupyter, you can do it here .如果你想尝试 Jupyter,你可以在这里进行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM