Skip to content

Commit

Permalink
ssaep volumefadingfixes (#81)
Browse files Browse the repository at this point in the history
* fixed duration on instructions screen

* put sound object instantiation inside trials loop. fixes sound fading issue
  • Loading branch information
JohnGriffiths authored Jun 16, 2024
1 parent fad804b commit e902b73
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions eegnb/experiments/auditory_ssaep/ssaep_onefreq.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from pandas import DataFrame
from psychopy import prefs

prefs.general["audioLib"] = ["pygame"]
#prefs.general["audioLib"] = ["pygame"]
from psychopy import visual, core, event, sound
from pylsl import StreamInfo, StreamOutlet
from scipy import stats
Expand Down Expand Up @@ -75,8 +75,8 @@ def present(
mywin.flip()


# Show the instructions screen
show_instructions(10)
# Show the instructions screen
show_instructions(duration)


# start the EEG stream=
Expand All @@ -87,19 +87,19 @@ def present(
# Intertrial interval
core.wait(iti + np.random.rand() * jitter)

# Select stimulus frequency
ind = trials["stim_freq"].iloc[ii]
auds[ind].stop()
auds[ind].play()
# Create auditory sound object and play tone
aud = sound.Sound(am1)
aud.setVolume(0.8)
aud.play()

# Push sample
if eeg:
timestamp = time()
if eeg.backend == "muselsl":
marker = [markernames[ind]]
marker = [markernames[1]]
marker = list(map(int, marker))
else:
marker = markernames[ind]
marker = markernames[1]
eeg.push_sample(marker=marker, timestamp=timestamp)

# offset
Expand Down

0 comments on commit e902b73

Please sign in to comment.