The question I asked in this post is no longer relevant. I managed to solve the problem with AudioPlay followed by Pause, long enough to have the whole audio file played. At this time, I get the program to work on a Notebook but not on the Cloud.
I am trying to create a perception test consisting of a loop within which sound files are automatically played, one at a time, followed by an input dialogue where the subject types an answer (or clicks on an answer box), but so far I have been unable to make it work as I would like to. The problem is that I need to include both the sound presentation and the collection of the subject's response in a cell so that the subject does not have to start separate cell evaluations:
- Evaluate the first cell to start the presentation of an audio file
- Click on the output to listen to the selected audio file
- Evaluate the next cell to get the input dialogue
- Manually loop through the process by going back to the first cell to get a new audio file...
When I run both the sound file and input dialogue box in the same cell, the dialogue box blocks the presentation of the sound file. I cannot get the audio file to sound "spontaneously" without clicking on the play-symbol, but even so it is truncated because the dialogue box seems to prevent Mathematica from loading the whole file. I have tried different methods to prevent the dialogue box from popping up before the sound file is played (Interrupt, Pause, Wait...) but none of them with success so far. Essentially, I am trying to create with Mathematica the kind of perception tests that can be set up with PsychoPy but unfortunately I have not yet been able to find relevant documentation on this forum. I wonder if there is a suitable solution or if I should perhaps give up and instruct the subjects to click multiple times to activate the cells (which is unfortunate because it disrupts the flow and introduces uncontrolled memory loads).
I am attaching a Notebook as a simple illustration of what I am trying to do in a more smooth way.
Best Francisco
Attachments: