Scale data and play as sound
soundsc(
scales
the values of audio signal y
)y
to fit in the range
from –1.0 to 1.0, and then sends the data to the speaker at
the default sample rate of 8192 hertz. By first scaling the data, soundsc
plays
the audio as loudly as possible without clipping. The mean of the
dynamic range of the data is set to zero.
soundsc
ignores nBits
. Instead, it
plays audio data using the default number of bits per sample of the output audio
device.
The sound
function supports sound
devices on all Windows® and most UNIX® platforms.
Most sound cards support sample rates between 5 and 48 kilohertz. Specifying a sample rate outside this range might produce unexpected results.
Audio playback in MATLAB Online is supported in Google Chrome™.
audioplayer
| audioread
| audiowrite
| sound