ipytone.AudioBuffer#
- class ipytone.AudioBuffer(**kwargs: Any)#
Bases:
ToneObjectAudio buffer loaded from an URL or an array.
- Parameters:
url_or_array (str or array-like or array widget) – Buffer file (URL) or data.
sync_array (bool, optional) – If True, the array trait will be synchronized as soon as the audio buffer is loaded in the front-end (default: False). It is ignored if an array is already given as buffer data or if the duration of the buffer exceeds 10 seconds.
reverse (bool, optional) – If True, the audio buffer is reversed (default: False).
- __init__(url_or_array, sync_array=False, reverse=False, **kwargs)#
Public constructor
Methods
dispose()Dispose and disconnect this node.
Attributes
arrayA trait type representing a Union type.
Buffer loaded from this URL (None if an array is used)
Returns True if the node was disposed (i.e., disconnected and web audio node freed for garbage collection).
Buffer duration in seconds (0 if not loaded)
Buffer size in samples (0 if not loaded)
True if the audio buffer is loaded
logA trait whose value must be an instance of a specified class.
Number of discrete audio channels (0 if not loaded)
True if the buffer is reversed
Buffer sample rate (0 if not loaded)
- buffer_url#
Buffer loaded from this URL (None if an array is used)
- 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).
- duration#
Buffer duration in seconds (0 if not loaded)
- length#
Buffer size in samples (0 if not loaded)
- loaded#
True if the audio buffer is loaded
- n_channels#
Number of discrete audio channels (0 if not loaded)
- reverse#
True if the buffer is reversed
- sample_rate#
Buffer sample rate (0 if not loaded)