Millisecond Forums

Audio issues

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

By sbashyam - 9/6/2023

Hi Dave,

In my current study, I have set up some images appearing in a random order. The participant is required to count the number of animals on screen and enter a value. I was able to write the code for this and it works. However, I am having trouble adding audio to the trials. At the display of every image, I want two audio files to be played (both included in the folder attached below) - first "what_card.wav" and then "CanUCount.wav". My issue is that when I try to make the </sound> category, I am given an error about double quotes, even though I have double quotes in my syntax.

Could you please help me out?
https://drive.google.com/drive/folders/1zUe3Rj-OsPwauF1esQQbyrpwgad4QeEa?usp=share_link
By Dave - 9/6/2023

sbashyam - 9/7/2023
Hi Dave,

In my current study, I have set up some images appearing in a random order. The participant is required to count the number of animals on screen and enter a value. I was able to write the code for this and it works. However, I am having trouble adding audio to the trials. At the display of every image, I want two audio files to be played (both included in the folder attached below) - first "what_card.wav" and then "CanUCount.wav". My issue is that when I try to make the </sound> category, I am given an error about double quotes, even though I have double quotes in my syntax.

Could you please help me out?
https://drive.google.com/drive/folders/1zUe3Rj-OsPwauF1esQQbyrpwgad4QeEa?usp=share_link

Do you see how these double-quotes look kind of curly?



These are simply the wrong quote characters (don't copy & paste from word processors or the like). You need to use plain double-quotes, i.e.



<sound whats_card>
/ items = ("what_card.wav")
/ playthrough = true
</sound>
By sbashyam - 9/6/2023

Thank you Dave! Can you also tell me how I can play the audios for each trial?
By Dave - 9/6/2023

sbashyam - 9/7/2023
Thank you Dave! Can you also tell me how I can play the audios for each trial?

You display <sound> stimuli just like any other type of stimulus, be it <text>, <picture>, <shape> or <video>. Add the sound stimulus to a <trial>'s /stimulustimes or -frames, at the time you want it played.
By Dave - 9/6/2023

Dave - 9/7/2023
sbashyam - 9/7/2023
Thank you Dave! Can you also tell me how I can play the audios for each trial?

You display <sound> stimuli just like any other type of stimulus, be it <text>, <picture>, <shape> or <video>. Add the sound stimulus to a <trial>'s /stimulustimes or -frames, at the time you want it played.

It's not entirely clear when, exactly, you want those audios played, but I'm guessing you want something like this:

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

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


being the two audios, and the trial playing those back one after the other before allowing the subject to continue.

<trial showpicture>
/ stimulustimes = [0=stimuli_display, whats_card; 2000=can_u_count; 5000=continue]
/ validresponse = (continue)
</trial>


Change the timings as needed if you want a longer or shorter pause between the two sounds.