pliers.stimuli.TranscribedAudioCompoundStim

class pliers.stimuli.TranscribedAudioCompoundStim(audio, text)[source]

Bases: CompoundStim

An AudioStim with an associated text transcription.

Parameters
  • filename (str) – The path to the audio clip.

  • audio (AudioStim) – An AudioStim containing the audio content.

  • text (ComplexTextStim) – A ComplexTextStim containing the transcribed text (and associated timing information).

__init__(audio, text)[source]
get_stim(type_, return_all=False)

Returns component elements of the specified type.

Parameters
  • type (str or Stim class) – the desired Stim subclass to return.

  • return_all (bool) – when True, returns all elements that matched the specified type as a list. When False (default), returns only the first matching Stim.

Returns

If return_all is True, a list of matching elements (or an empty list if no elements match). If return_all is False, returns the first matching Stim, or None if no elements match.

get_types()

Return tuple of types of all available Stims.

has_types(types, all_=True)

Check whether the current component list matches all Stim types in the types argument.

Parameters
  • types (Stim, list) – a Stim class or iterable of Stim classes.

  • all (bool) – if True, all input types must match; if False, at least one input type must match.

Returns

True if all passed types match at least one Stim in the component list, otherwise False.