Tools for sharing audio

audiotools.post.audio_table(audio_dict: dict, first_column: Optional[str] = None, format_fn: Optional[Callable] = None, **kwargs)[source]

Embeds an audio table into HTML, or as the output cell in a notebook.

Parameters
  • audio_dict (dict) – Dictionary of data to embed.

  • first_column (str, optional) – The label for the first column of the table, by default None

  • format_fn (Callable, optional) – How to format the data, by default None

Returns

Table as a string

Return type

str

Examples

>>> audio_dict = {}
>>> for i in range(signal_batch.batch_size):
>>>     audio_dict[i] = {
>>>         "input": signal_batch[i],
>>>         "output": output_batch[i]
>>>     }
>>> audiotools.post.audio_zip(audio_dict)
audiotools.post.disp(obj, **kwargs)[source]

Displays an object, depending on if its in a notebook or not.

Parameters

obj (Any) – Any object to display.

audiotools.post.in_notebook()[source]

Determines if code is running in a notebook.

Returns

Whether or not this is running in a notebook.

Return type

bool