h6. [[SoundDMA]] h6(. » [[SoundDMA SWI Calls|SWI Calls]] h6((. » [[Sound_SampleRate]] h6(((. » Sound_SampleRate 2 h2. Sound_SampleRate 2 h5. (SWI &40146) |_<^{width:4em}. Entry | |<^. R0 |<^. 2 (Reason code) | |<^. R1 |<^. Sample rate index (1+) | |_<^{width:4em}. Exit | |<^. R2 |<^. Corresponding sample rate value (1/1024Hz) | |\2<^. All other registers preserved | h4. Use This call can be used to read the sample rate value that corresponds to a given index. Internally sample rates are sorted in increasing order. This allows a binary chop or similar algorithm to be used to find the sample rate that's closest to a given desired rate without having to iterate through all the available rates. h4. Notes This SWI should only be used if [[Sound_Mode 0]] indicates that 16 bit sound output is supported. Sample rate indices are 1-based. [[Sound_SampleRate 0]] can be used to find the number of available rates, i.e. the maximum permissible value for R1. Sample rates are measured in units of 1/1024Hz. E.g. 22050Hz would be represented as 22050*1024 = 22579200. [[Sound_SampleRate 3]] can be used to set the current sample rate. h4. See also * [[Sound_Mode 0]] * [[Sound_SampleRate 1]] * [[Sound_SampleRate 3]]