Functions

Tone

Sound a speaker tone for a specified frequency and duration

Syntax

Signature
void Tone( int frequency, int duration );

Arguments

frequency Frequency in hertz. On Windows the audible range accepted by the system call is 37 through 32767.

duration Length in ticks of approximately 1/18.2 second.

Return value

No return value.

Description

Use a short tone to signal an application event, such as an input error or a finished operation. The call waits for the specified duration in ticks of about `1/18.2` second. Windows plays supported frequencies synchronously. An unsupported frequency or a non-Windows build waits silently for the same duration.

Example

tone.c
#include "xdev-wtui.h"

int main( void )
{
   Tone( 440, 9 );

   return 0;
}