[open] Error- cannot create sound object
Hi all,
Yesterday, I was running an experiment and all of a sudden it crashed when it was about 80% done. Here's the debug message:
Python 2.7.3
Type "help()", "copyright()", "credits()" or "license()" for more information.
Type "modules()" for details about installed modules and version information.
Use the "print [msg]" statement in inline_script items to print to this debug window.
openexp._canvas.legacy.init_display(): enabling hardware surface
openexp._canvas.legacy.init_display(): enabling double buffering
openexp._canvas.legacy.init_display(): video mode ok
openexp.sampler._legacy.init_sound(): sampling freq = 48000, buffer size = 512
openexp.sampler._legacy.init_sound(): mixer already initialized, closing
experiment.init_log(): using 'C:/data/experiment Patrick/testHappy2/subject-3.csv' as logfile (utf-8)
experiment.run(): experiment started at Mon Sep 23 15:43:51 2013
Traceback (most recent call last):
File "dist\libqtopensesame\qtopensesame.py", line 1367, in run_experiment
File "dist\libopensesame\experiment.py", line 283, in run
File "dist\libopensesame\sequence.py", line 60, in run
File "dist\libopensesame\loop.py", line 159, in run
File "dist\libopensesame\sequence.py", line 120, in prepare
File "C:\Program Files\OpenSesame\plugins\sound_start_recording\sound_start_recording.py", line 142, in prepare
File "C:\Program Files\OpenSesame\plugins\sound_start_recording\Soundrecorder.py", line 50, in __init__
SoundError: Cannot create sound object. Error text is: 4,
Do any of you know what has happened and what could have triggered the error?
Regards,
Patrick
Comments
Hi Patrick,
I've no idea as I have never encountered this error, even after intensive use of the soundrecorder plugin. It seems as if your audio device was unavailable or engaged in some other activity. Is this the first time that this error occurred, or has it happened more frequently?
Hi Daniel,
I haven't had this problem on my regular laptop either. However, it doesn't work on the other laptop I was using, even though both laptops are identical, apart from some software that was installed on them. The experiment crashed from the beginning and kept doing so for another 5 times in a row, until I decided to quit for the day. What strikes me as odd is that the experiment records and creates soundfiles as it should for about 27 to 33 times (which is the greater part of the experiment), but suddenly and randomly reports this error at one of the last 8 to 13 moments it should record audio.
hi,
I have the same problem exactly,
except the difference in the number.
on my computer it breaks after exactly 10 words presented.
I would very appreciate help on this.
thank you,
Shilo
Does it occur both with wav and mp3 recording? Both of these modes use completely different python modules to do the heavy lifting, so it might be that the other mode which you are using does not suffer from the problem. If it occurs in both modes, it already narrows down the problem considerably, as it must be caused by something outside of pymedia and pyaudio (hardware/drivers/programming mistake from my side).
I have been working on a gstreamer implementation of sound recorder a few months ago as this library is far more reliable, but I don't trust the plugin enough to release it yet. If you want you can give it a spin at https://github.com/dschreij/opensesame_soundrecorder_plugins/tree/gstreamer. You also need to install the gstreamer sdk from http://www.gstreamer.com. I can however offer no guarantees yet that it will work at all!
Thank you for your help,
meanwhile I solved the problem by recording all the data for each subject.
if this wouldn't satisfy the researcher - I will try to use this second plugin that you suggested.
again, THANKS A LOT,
Shilo
This problem should now be solved in version 0.13