You can use the audioread
function in MATLAB to read the audio file and get the duration of the audio. Once you get the duration, you can use the pause
function to pause the execution of the code until the audio is finished playing.
Here's an example:
main.m268 chars15 lines
This will play the audio file and then wait for it to finish playing before continuing with the rest of the code.
gistlibby LogSnag