ipytone.AudioBuffers#

class ipytone.AudioBuffers(**kwargs: Any)#

Bases: ToneObject

A collection (dict-like) of audio buffers.

Parameters:
  • urls (dict-like) – A mapping of buffer names (str) and buffer file URLs (str) or AudioBuffer objects

  • base_url (str, optional) – Prefix to add before all the URLs.

__init__(urls, base_url='', **kwargs)#

Public constructor

Methods

add(key, url[, create_node])

Add or replace a buffer.

dispose()

Dispose and disconnect this node.

Attributes

base_url

buffers

Returns a dictionary with all buffers.

disposed

Returns True if the node was disposed (i.e., disconnected and web audio node freed for garbage collection).

loaded

Return True if all buffers are loaded.

log

A trait whose value must be an instance of a specified class.

add(key, url, create_node=True)#

Add or replace a buffer.

Parameters:
  • key (str) – Buffer name.

  • url (str or AudioBuffer.) – Buffer file URL (str) or AudioBuffer object.

  • create_node (bool, optional) – Internal use only.

property buffers#

Returns a dictionary with all buffers.

dispose()#

Dispose and disconnect this node.

property disposed#

Returns True if the node was disposed (i.e., disconnected and web audio node freed for garbage collection).

property loaded#

Return True if all buffers are loaded.