Millisecond Forums

Error when recording vocal responses + playing a sound

https://forums.millisecond.com/Topic23241.aspx

By RobertMcGill - 1/17/2018

Hello all,

In my experiment I will be recording participants' vocalizations, which are cued by both a visual (picture) and auditory (beep sound) signal. 
I have coded this as follows:

<trial 1>
/ stimulustimes = [0=image, beep]
/ beginresponsetime = 0
/ trialduration = 3000
/ validresponse = (anyresponse)
/ inputdevice = voicerecord
/ recorddata = true
/responseinterrupt = trial
</trial>

<picture image>
/ items = ("image1.jpg")
/ size = (700, 700)
</picture>

<sound beep>
/items = ("beep.wav")  
/playthrough = true    
</sound>

The problem is that when I run this, I get an error: DirectSound Error -2004353017: Unknown DirectSound error..  Line 170, File win\SoundPlayer.cpp

Recording vocal responses without playing a beep sound and vice versa is not a problem, but doing both simultaneously gives this error.

Doe anyone perhaps know how to solve this issue?

Thanks a lot in advance!

By Dave - 1/17/2018

RobertMcGill - Wednesday, January 17, 2018
Hello all,

In my experiment I will be recording participants' vocalizations, which are cued by both a visual (picture) and auditory (beep sound) signal. 
I have coded this as follows:

<trial 1>
/ stimulustimes = [0=image, beep]
/ beginresponsetime = 0
/ trialduration = 3000
/ validresponse = (anyresponse)
/ inputdevice = voicerecord
/ recorddata = true
/responseinterrupt = trial
</trial>

<picture image>
/ items = ("image1.jpg")
/ size = (700, 700)
</picture>

<sound beep>
/items = ("beep.wav")  
/playthrough = true    
</sound>

The problem is that when I run this, I get an error: DirectSound Error -2004353017: Unknown DirectSound error..  Line 170, File win\SoundPlayer.cpp

Recording vocal responses without playing a beep sound and vice versa is not a problem, but doing both simultaneously gives this error.

Doe anyone perhaps know how to solve this issue?

Thanks a lot in advance!


That DirectSound Error is indicative of a problem with the "beep.wav" file you are using. Specifically, the file probably has the wrong sample size (32bits). Windows DirectSound API (which the <sound> element maps to) expects files to have a sample size of 16bits. If you open said file in an audio editor of your choice and save explicitly save it as 16-bit PCM WAV, things should work fine.

If you have trouble figuring out how to do this, put the WAV file in a ZIP archive and attach it to this thread (click +Insert -> Add File). I can then convert the file to 16-bit sample size for you.