Audio frequency generator: Difference between revisions

From Rosetta Code
Content added Content deleted
m (minor grammatical changes)
m (categories)
Line 24: Line 24:
{{omit from|TPP}}
{{omit from|TPP}}


[[Category:Electronics]]

[[Category:Temporal Media]]
[[Category:Science]]
[[Category:Temporal media]]

Revision as of 07:55, 23 February 2013

Audio frequency generator is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

An audio frequency generator produces a continual audible monotone at a set frequency and level of volume. There are controls to adjust the frequency and the volume up and down as desired. Some also have a selector to switch the waveform type between sine wave, square wave and triangular sawtooth.

The task is to emulate an audio frequency generator. It is permissible to use an inbuilt computer speaker if the system does not have the facility to utilize dedicated sound hardware.

The solution should include:

  • A demonstration of how to check for availability of sound hardware on the system (on systems where this is possible)
  • A demonstration of how to produce a continual audible monotone (on sound hardware this would typicvally be a sine wave)
  • A method of adjusting the frequency and volume of the monotone. (one way would be to use left and right arrow keys to increase or decrease frequency, and up and down keys to increase or decrease the volume)
  • A method to silence or reset the sound hardware on exit.

Optionally the solution can also include:

  • A demonstration of how to fall back to internal speaker, if sound hardware is not available
  • A facility to switch between sine wave, square wave and triangular sawtooth

Languages that provide no facilities for utilizing sound hardware of any kind should be omitted.