import IPython.display import numpy as np import json from scipy.io.wavfile import write def Audio(audio: np.ndarray, rate: int, name: str): filename = f"output/{name}.wav" amplitude = np.iinfo(np.int16).max write(filename, rate, (audio*amplitude).astype(np.int16)) return IPython.display.Markdown(f"[{filename}]({filename})") return IPython.display.HTML(f"""
{filename} """)