I’ve tried playing the same sound file using PyGame and it also doesn’t play but Spyder behaves as though the script has been run successfully and exits the process and opens a new kernel.
The sound does play successfully using pyglet and pyaudio.
I’m at a complete loss as what to try next. I do a lot of work from home so you can image how frustrating this is.
Any help or insight on this issue would be great and very much appreciated.
Could you install PsychoPy Standalone and try form there instead of Spyder?
I don’t know if this is a problem on your machine or a problem with anaconda install of pyo (which I don’t personally support) or a problem with running from spyder (which I don’t personally support).
Sorry, I still don’t have any idea. If Pyo fails it usually provides an error message. One thing that’s strange is that your sound “LRsound” appears not to have an extension (like .wav). Are you sure that the file is being found at all? It looks like you’ve also got no .py extension on your script which is not a good idea either, but I don’t think that’s your problem with the sound not playing.
You could increase the amount of info you get about what’s happening by stting psychopy’s logging to debug level and make sure you have a pause so that the sound can play.
from psychopy import sound, logging, core
logging.console.setLevel(logging.DEBUG)
play_audio1 = sound.SoundPyo(value = 'LRsound', stereo = True)
play_audio1.play()
core.wait(5) # wait so the sound can play
When running your script from above I get the following errors:
Server not booted.
The Server must be booted!
portaudio error in Pa_OpenStream: Illegal combination of I/O devices
Portaudio error: Illegal combination of I/O devicesportaudio error in Pa_AbortStream: PortAudio not initialized
portaudio error in Pa_CloseStream: PortAudio not initialized
portaudio error in Pa_Terminate: PortAudio not initialized
I am using stereo speakers for my sound output, in case that is useful information.
According to google this is something to do with duplex audio
streams, but it's all in the pyo library the portaudio lib that
sits behinds that (not my expertise). It's going to be something
along the lines of trying to create an input (mic) and an output
(speakers) that have incompatible drivers and so don't work
together.
I think the pyo library has commands to find out what the
available input and output devices are and to tell you what the
default devices are too. That might help work out what's wrong.