How do I switch between audio files, maintaining the same position in either file?

I'm building a GUI to perform some psychoacoustic tests.
The subjects will be able to click on a button and some audio will start playing. If they click on a different button, a different audio should start playing but from the same position that the first one was at when the user clicked the 2nd one.
The only difference between each audio is there amplitude (same duration and sampling rate).
I have already prepared my files and wrote a piece of code so that they are imported when the GUI initializes (I used setappdata so I can share it between functions).
My main problem right now is to make a continuous play i.e. when the user presses a second button, I should save the current sample and make other audio file to start playing from that position.

1 Comment

I would preload all of the files if they're relatively small and this is an option. What code are you using now to play them?

Sign in to comment.

Answers (0)

Asked:

on 14 Oct 2013

Commented:

on 14 Oct 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!