Scale data and play as sound
soundsc(
scales the values of audio signaly
)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
ignoresnBits
. Instead, it plays audio data using the default number of bits per sample of the output audio device.
Thesound
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 inMATLAB Onlineis supported in Google Chrome™.