Replies: 5 comments
-
Hi @Dommelen ! A couple things could be causing this issue.
jsPsych.init({
timeline: timeline,
use_webaudio: false
}) |
Beta Was this translation helpful? Give feedback.
-
@Dommelen, could you post a .zip file with your experiment? |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your suggestions. Unfortunately, they don't seem to help. Wim van Dommelen |
Beta Was this translation helpful? Give feedback.
-
Citing the appropriate section from the documentation:
You had to preload the audio files, as @jodeleeuw had said. I've done so in the working example attached. I've removed the use_webaudio: false line because it is not necessary in this case. Next time, please provide the complete experiment in the zip file. It's hard to test otherwise. I've used copies of same sample wav file for demonstraction. The complete zip is attached. Here's the diff from the file you sent. 22a23,29
> var all_audio_files = [
> "audio/word01.wav",
> "audio/word02.wav",
> "audio/word03.wav",
> "audio/word04.wav"
> ]
>
60a68
>
66,68c74,78
< use_webaudio: false,
< on_finish: function(){jsPsych.data.displayData();},
< on_finish: function(){jsPsych.data.get().localSave('csv','Audiodata.csv');},
---
> preload_audio: all_audio_files,
> on_finish: function(){
> jsPsych.data.displayData();
> jsPsych.data.get().localSave('csv','Audiodata.csv');
> }
71c81
< </html>
\ No newline at end of file
---
> </html> |
Beta Was this translation helpful? Give feedback.
-
Now it works! I used your code with one exception: The line "use_webaudio: false," had to be included. |
Beta Was this translation helpful? Give feedback.
-
I wonder if it is possible to play a list of audio stimuli several times in random order. Using the code shown below doesn't work. Running the script doesn't generate any output. The crucial line seems to be "stimulus: jsPsych.timelineVariable('stimulus')," It would be great if somebody could tell me what I am doing wrong.
Beta Was this translation helpful? Give feedback.
All reactions