Language Reference
Documentation

Language

Objects
Internet Objects

Sound Class

Has Constructor: NO, Can Create Instance: NO
Can Subclass: NO

To obtain a sound object you must use the OpenAsSound method of the File object that represents the sound file. In Macintosh the file must be a System 7 sound file. In Windows a WAVE file. If QuickTime is installed in Windows you can open MP3, MIDI and MPEG sound files.

See Also: File,GetFile

Methods

IsPlaying
Syntax: Sound.IsPlaying as Integer

Returns 1 (true) if the sound is playing, 0 (false) if not.

PAN
Syntax: Sound.PAN(Value as Integer)

Sets the balance of the speaker. The value of 0 indicates equal volume on the left and right speaker. The value of 100 plays only on the right speaker. The value of -100 plays on the left speaker only.

PLAY
Syntax: Sound.Play

Plays the sound.

PLAYLOOPING
Syntax: Sound.PlayLooping

Plays the sound in an infinite loop.

STOP
Syntax: Sound.Stop

Stops the sound.

Volume
Syntax: Sound.Volume(Value as Integer)

Sets the volume of the sound. Value must be in the range of 0 to 100. Where 100 is equal to the system volume. The Default is 100. This value is relative to the current system volume.

Sample Code

dim f as file,s as sound

//Gets the current folder
f = getfile("")

//Opens the sound temp.snd in a folder named Sounds
//in the current folder
f = f.child("Sounds").child("temp.snd")

//Opens the sound and plays it
s = f.OpenAsSound
s.play