Skip to content

sound

audio · scripts/audio/sound.m

SOUND  Play audio data on the default audio output device.

  SOUND (Y, FS)
  SOUND (Y, FS, NBITS)

  Y holds the samples (a vector, or a samples-by-channels matrix) with
  values in [-1, 1]; FS is the sample rate in Hz (default 8192) and NBITS
  the resolution (8, 16 or 24; default 16).  SOUND returns immediately
  while the sound plays in the background; use AUDIOPLAYER and
  PLAYBLOCKING to wait for the end of the sound.  Values outside [-1, 1]
  are clipped.  Without a usable audio output device SOUND raises an error.