Microsoft Small Basic


Sound

The Sound object provides operations that allow the playback of sounds. Some sample sounds are provided along with the library.

Operations

PlayClick

Sound.PlayClick()

Plays the Click Sound.

Returns

Nothing

PlayClickAndWait

Sound.PlayClickAndWait()

Plays the Click Sound and waits for it to finish.

Returns

Nothing

PlayChime

Sound.PlayChime()

Plays the Chime Sound.

Returns

Nothing

PlayChimeAndWait

Sound.PlayChimeAndWait()

Plays the Chime Sound and waits for it to finish.

Returns

Nothing

PlayChimes

Sound.PlayChimes()

Plays the Chimes Sound.

Returns

Nothing

PlayChimesAndWait

Sound.PlayChimesAndWait()

Plays the Chimes Sound and waits for it to finish.

Returns

Nothing

PlayBellRing

Sound.PlayBellRing()

Plays the Bell Ring Sound.

Returns

Nothing

PlayBellRingAndWait

Sound.PlayBellRingAndWait()

Plays the Bell Ring Sound and waits for it to finish.

Returns

Nothing

PlayMusic

Sound.PlayMusic(notes)

Plays musical notes.

notes

A set of musical notes to play. The format is a subset of the Music Markup Language supported by QBasic.

Returns

Nothing

Play

Sound.Play(filePath)

Plays the Click Sound.

filePath

Returns

Nothing

PlayAndWait

Sound.PlayAndWait(filePath)

Plays an audio file and waits until it is finished playing. This could be an mp3 or wav or wma file. Other file formats may or may not play depending on the audio codecs installed on the user's computer. If the file was already paused, this operation will resume from the position where the playback was paused.

filePath

The path for the audio file. This could either be a local file (eg: c:\music\track1.mp3) or a file on the network (eg: http://contoso.com/track01.wma).

Returns

Nothing

Pause

Sound.Pause(filePath)

Pauses playback of an audio file. If the file was not already playing, this operation will not do anything.

filePath

The path for the audio file. This could either be a local file (eg: c:\music\track1.mp3) or a file on the network (eg: http://contoso.com/track01.wma).

Returns

Nothing

Stop

Sound.Stop(filePath)

Stops playback of an audio file. If the file was not already playing, this operation will not do anything.

filePath

The path for the audio file. This could either be a local file (eg: c:\music\track1.mp3) or a file on the network (eg: http://contoso.com/track01.wma).

Returns

Nothing