Class:Sound
From Torque Wiki
⧼monobook-jumptonavigation⧽⧼monobook-jumptosearch⧽
Sound
Utility methods for dealing with generating simple sounds - since vesion 1.12.42
Methods
/**
* Play a sequence of pitches
*
* The tones are played in their own thread so execution will continue without pausing.
*
* @param pitches a pitch of 0 means no sound, but just pause for 'duration' in playback
* @param durations
*/
public static void playTones(final int[] pitches, final int[] durations);
/**
* Play a single tone.
*
* The tone is played asynchronously
*
* @param pitch a pitch of 0 means no sound, but just pause for 'duration' in playback
*/
public static void playTone(int pitch, long durationMillis);
Examples
An example usage might look like:
// Play a positive sounding 'connected' type sound
Sound.playTones([400,600,800], [50,50,50]);
// Play the letter 'C' in morse code.
Sound.playTones([600,0,600,0,600,0,600], [500,100,200,100,500,100,200]);