aspsim.signal.sources.Sequence

class aspsim.signal.sources.Sequence(audio, amp_factor=1, end_mode='repeat')

Bases: Source

Will play the supplied sequence

Parameters:
  • played. (audio is np.ndarray of audio samples to be) – Shape is (num_channels, num_samples)

  • end_mode (can be any of {'repeat', 'zeros', 'raise'}) – with ‘repeat’ the sequence starts over again indefinitely with ‘zeros’ the sequence plays once and then only 0s with ‘raise’ the source will raise an exception if get_samples() is called after the sequence is finished

__init__(audio, amp_factor=1, end_mode='repeat')

Will play the supplied sequence

Parameters:
  • played. (audio is np.ndarray of audio samples to be) – Shape is (num_channels, num_samples)

  • end_mode (can be any of {'repeat', 'zeros', 'raise'}) – with ‘repeat’ the sequence starts over again indefinitely with ‘zeros’ the sequence plays once and then only 0s with ‘raise’ the source will raise an exception if get_samples() is called after the sequence is finished

Methods

__init__(audio[, amp_factor, end_mode])

Will play the supplied sequence

get_samples(num_samples)