I will need to use the script below for a listening test. is still not as I need it and the deadline is approaching so I decided to come here and find out if someone can help. (Thanks in advance!)
Information about the script: I am using GUI; among other tools that are not relevant for this specific problem I have included 2 pushbuttons which are causing me some problems. One pushbutton is supposed to play one audio sample (randomly) out of 3 existing audio samples. The other pushbutton is supposed to play the sample again if the listener needs it.
My problems are due to this:
1- Each sample needs to be played randomly but the user needs to be able to listen to it again if he wants. I would like to use the "REPEAT" button for that.
2- I am using a different GUI for each of the three audio samples that will be evaluated by the listener (probably the worst idea ever as the GUIs are exactly the same, but it's how I managed to make it work so far). Each GUI has a "NEXT" button to close the old GUI and open the next one.
When the user changes from the first GUI to the second, the previously evaluated sample, must not be included in the random operation as they can't evaluate the same audio sample twice during the test.
——> I am not being able to solve these two issues and the deadline is almost here. PLEASE I need some help.
Thank you very much!
This is the code I am using for the pushbutton PLAY at the moment:
a = audioread('guitar.wav');b = audioread('cinematic.wav'); c = audioread('epicorchestra.wav'); numsounds = 3; sounds = { a; b; c;} orders=randperm(numsounds,3); % random order
%pick one of the positions in "orders"
location = randi(length(orders)); % extract wave data from line identified by "locations" in column one.
wavData = sounds{location, 1}; % sampling frequency (same for all audio files)
sf = 48000 % play audio sample with that wavdata and corresponding sampling
% frequency
soundsc(wavData, sf);
Best Answer