Problem when playing wav files
Hello! I'm having a problem with one experiment I made where the participants have to listen to different types of sounds.
Each wav file lasts exactly for 2 seconds, and when I play them in the experiment, somehow the pitch of the sound is much higher and the duration is shorter. I was wondering if there is any parameter I can modify to solve this issue?
Thank you very much
Comments
The pitch is likely due to the wrong sampling rate being selected in the backend. Go to "Backend Settings", and then under "Sampler" there should be a setting called "Sampling frequency". You want that number to match the sampling frequency of your recordings.
It indeed sounds like a mismatch in sampling rate between your sound file and the audio system. However, there is no such thing as "Backend Settings" or "Sampler" in Expyriment.
There are two ways to fix this:
expyriment.control.defaults.audiosystem_sample_rate=???.Hope this helps.
Hello! Thank you so much for the responses. I checked the sampling rate of the files, and they are all 16k, so I set the sampling rate to expyriment.control.defaults.audiosystem_sample_rate=16000 before loading them, but the problem persists...any other ideas?
Sorry for the double posting, but it's solved now! I made the mistake of changing the sample rate after initializing the experiment haha. Thank you again!
Hi,
You will need to set
expyriment.control.defaults.audiosystem_sample_rate=16000before the audio system is started (which by default is right when an experiment is initialized). Hence, put that line right after you imported Expyriment.However, 16000 is a very uncommon (and very low) sampling rate I have to say (this means that the sound file does not include any frequencies above 8Khz). Are you sure that this is correct?