The samples of an audio signal stored in an array can be played back over your computer’s speakers using the built-in function: sound.
The basic syntax for using the function is the following:
sound(y,Fs)
Input Variables:
y – an array containing the samples of the signal.
Fs – a scalar representing the sampling rate of the signal.
Continue on to learn about saving audio to a file with the audiowrite function.
Further documentation for the function is available here.
Links to other related functions: audioread, audiowrite, audioinfo

