RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

Sound_SampleRate 3 (changes)

Showing changes from revision #1 to #2: Added | Removed | Changed

Programmer's SoundDMA Reference Manuals
» Part 15 – SWI Calls
» Sound Sound_SampleRate
» Sound_SampleRate 3Sound_SampleRate
» Sound_SampleRate 3

Sound_SampleRate 3

(SWI &40146)
Entry
R0 3 (Reason code)
R1 Sample rate index (1+)
Exit
R1 Previous sample rate index (1+)
R2 Previous sample rate value (1/1024Hz)
All other registers preserved

Use

This call can be used to set the current sound system sample rate. Rather than specifying the sample rate value directly you must use Sound_SampleRate 0 and Sound_SampleRate 2 to find the index that’s closest to your desired sample rate, and then set the rate using that index.

The previously set sample rate index and value will be returned by the call.

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.

Sample rates are measured in units of 1/1024Hz. E.g. 22050Hz would be represented as 22050*1024 = 22579200.

Sound_SampleRate 1 can be used to read the current sample rate setting without altering it.

It is also possible to alter the sample rate of the sound system by passing a sample period to Sound_Configure. However when the 16 bit sound system is in use this behaviour is discouraged; all that will happen is that SoundDMA will pick the closest available rate out of the list of rates supported by the hardware and then use that. In some cases this may be an exact match for the requested rate, while in other cases it may differ significantly.

See also

  • Sound_Mode 0
  • Sound_SampleRate 0
  • Sound_SampleRate 1
  • Sound_SampleRate 2
  • Sound_Configure
Revised on November 13, 2017 01:33:45 by Alan Robertson (52) (49.192.18.196)
Edit | Back in time (1 revision) | Hide changes | History | Views: Print | Source | Linked from: Sound_SampleRate, Sound_SampleRate 1, Sound_SampleRate 2

Search the Wiki

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys