Randomly playing wav. files from the file pool.
Hello,
I'm new to both python and opensesame. So, my struggle is briefly as follows;
- I need to play 90 different audio files for each participant. (These audio files are one second long, and they are in my file pool.)
- Mouse clicking response must be received from the subject when each sound is played. (I have an inline code for a slider on the screen that participants should select a point on it and then click to respond.)
- After that, a new response should be received by playing the next sound.
- This loop must continue 90 times until all audio files are played randomly.
- Also, the sound should play while the slider is on the screen, so I need to implement a code to my slider's inline script.
I'm waiting for your suggestions,
Best,
Comments
Hi ozgendk,
I have a suggestion for the random sound play for you.
Important: The sound files in your pool have to have the same name with an ongoing number
Example: Sound_file_1, Sound_file_2,....., Sound_file_90
Here is the code for that:
I hope this will help you a bit.
For the parallel sound playing and the screen presentation (slider) take a look ate the "threading" module. Keep in mind to keep the slider function in the mainthread.