Tone.Play (int Pitch, int Duration) Method

Generates the tone as a simple monotonic sound based on a specified pitch and duration and the CurrentVolume property of the Tone instance.

Syntax

public int Play( int Pitch, int Duration )

Parameters

Pitch
The tone's frequency specified in cycles-per-second (Hertz), subject to range limits defined by Tone.PITCH. The CurrentPitch property is not altered by the specified Pitch value.

Duration
The tone's duration in milliseconds, subject to range limits defined by Tone.DURATION. The CurrentDuration property is not altered by the specified Duration value.

Return Value

A result code that indicates either success or a particular fault condition. This value can be tested with helper methods.

More Information

Tone Class