I am trying to generate a sound (bleep) using the following code:
from psychopy import prefs prefs.general['audioLib'] = ['pyo'] from psychopy import sound, core import numpy as np val = 10*np.ones(2200) song = sound.Sound(value=val, secs=0.05, octave=8, stereo=True, volume=1.0, loops=0, sampleRate=44100, hamming=False) core.wait(1.0) song.play() core.wait(1.0) song.stop(log=True)
However, every time I run the code either PsychoPy crashes or it doesn’t stop and I have to manually stop the program.
I have also used string notes instead of the array of ones, but the problem still persists.
I am new to PsychoPy and this is my first PyschoPy code. Could you please help me figure out how I could resolve the issue?