Open Sound System |
Do you have problems with sound/audio application development? Don't panic! Click here for help! |
Most audio devices support only the standard sampling rates such as 8000, 11025, 22050, 24000, 32000, 44100, 48000, 88200, 96000, 192000 and possibly few others. Some devices support just one of them. In addtion many professional devices can be locked to one sampling rate.
Few devices are capable to support any sampling rates withing certain minimum and maximum values. This capability is used to indicate such devices.
There is no need to check the available sampling rates in normal applications since OSS will do the required conversions automatically. However if necessary this can be checked using SNDCTL_AUDIOINFO. The PCM_CAP_FREERATE capability tells how the sample rate information should be interpreted.
Audio device capabilities like PCM_CAP_FREERATE can be checked using the SNDCTL_AUDIOINFO or SNDCTL_DSP_GETCAPS ioctl calls.