Skip to content

failure to make sound with "IPython.display import Audio, display"  #1947

@stonebig

Description

@stonebig

Bug: Notebook Editor, Interactive Window, Editor cells

I can't get the sound button working on this widget: the sound button is grey/not clickable

%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from ipywidgets import interactive
from IPython.display import Audio, display
def beat_freq(f1=220.0, f2=224.0):
    max_time = 3
    rate = 8000
    times = np.linspace(0,max_time,rate*max_time)
    signal = np.sin(2*np.pi*f1*times) + np.sin(2*np.pi*f2*times)
    print(f1, f2, abs(f1-f2))
    display(Audio(data=signal, rate=rate))
    try:
         plt.plot(signal); #plt.plot(v.result);
    except:
         pass
    return signal
v = interactive(beat_freq, f1=(200.0,300.0), f2=(200.0,300.0))
display(v)

Steps to cause the bug to occur

  1. run this cell in a jupyter notebook

Actual behavior

sound button is grey / not clickable

image

Expected behavior

I can launch and hear the sound

Your Jupyter and/or Python environment

  • Winpython, Jupyter-2.2, vscode-1.44.2

Please provide as much info as you readily know

  • **Jupyter server running: Local
  • **Extension version: 2020.4.74986
  • **VS Code version: 1.44.2
  • **Setting python.jediEnabled: (the default , don't know what it is)
  • Python and/or Anaconda version: Python-3.8.2 (Winpython64-3.8.2.1b2.exe)
  • OS: Windows | Mac | Linux (distro): Windows 10 1909
  • **Virtual environment: nothing

remark: all the rest of this works, so it's not bad at all https://github.com/winpython/winpython_afterdoc/blob/master/docs/Winpython_checker.ipynb

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions