MATLAB: What is the maximum sample rate supported by sound()

sound sample rate limit

I have a set of software produced for the purpose of demonstrating sigma-delta digital-to-analog conversion as used by audio CDs. Everything works fine until it tries to play the signal resampled at 32 Fs (32*8000 = 256,000). Then it gives out the following error:
Error using sound (line 76) Device Error: Invalid sample rate
Error in soundsc (line 53) sound(varargin{:})
The command was: soundsc(analog_output,256000) where: analog_output is a 1×32,485 vector of sound samples ranging from -1.5145 to 1.5151 The only limit I have been able to find are in audio player.m where: MinimumSampleRate = 80 MaximumSampleRate = 1e6 are specified. 256,000 should be in those bounds. Am I hitting a hardware or API limit on the Macintosh? If so, how do I find that limit other than trial and error (128,000 works)

Best Answer

See the documentation on audiodevinfo.
It depends on your audio card. See for example Windows: How to determine your audio card's, or USB mic's, maximum sampling rate. For a Mac, I suggest a DuckDuckGo search on ‘sound card maximum sampling rate macintosh’ to see how to determine that.