What is the maximum sample rate supported by sound() ?
41 views (last 30 days)
Show older comments
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 1x32,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)
0 Comments
Accepted Answer
Star Strider
on 1 Apr 2015
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.
2 Comments
Star Strider
on 2 Apr 2015
My pleasure. I also found it difficult to get the same information on my sound card when I tried it (Win 8.1 here). It never occurred to me to consider those limits before you raised them in your Question.
More Answers (1)
nasir
on 10 Mar 2017
Sample rate, in hertz, of audio data y, is specified as a positive number from 1000 through 384000. Valid values depend on both the sample rates permitted by MATLAB® and the specific audio hardware on your system. MATLAB has a hard restriction of 1000 Hz <= Fs <= 384000 Hz, although further hardware-dependent restrictions apply.
0 Comments
See Also
Categories
Find more on Audio I/O and Waveform Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!