Skip to content

Commit

Permalink
Merge pull request psychopy#6793 from TEParsons/dev-enh-mic2sound
Browse files Browse the repository at this point in the history
ENH: Allow Sound to receive a Microphone object as its sound
  • Loading branch information
TEParsons committed Aug 14, 2024
2 parents 03d4126 + 74c71c8 commit a03f3ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions psychopy/sound/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,12 @@ def setSound(self, value, secs=0.5, octave=4, hamming=True, log=True):
"""
# Re-init sound to ensure bad values will raise error during setting:
self._snd = None

# make references to default stim into absolute paths
if isinstance(value, str) and value in defaultStim:
value = defaultStimRoot / defaultStim[value]

# if directly given a Microphone, get its last recording
if hasattr(value, "lastClip"):
value = value.lastClip
# Coerces pathlib obj to string, else returns inputted value
value = pathToString(value)
try:
Expand Down

0 comments on commit a03f3ac

Please sign in to comment.