Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Small Basic: Reference Documentation > Sound
http://smallbasic.com/img/object_32.png
Sound
The Sound object provides operations that allow the playback of sounds. Some sample sounds are provided along with the library.
Operations
http://smallbasic.com/img/method_16.png PlayClick
Sound.PlayClick()
Plays the Click Sound.
Returns
Nothing
http://smallbasic.com/img/method_16.png PlayClickAndWait
Sound.PlayClickAndWait()
Plays the Click Sound and waits for it to finish.
Returns
Nothing
http://smallbasic.com/img/method_16.png PlayChime
Sound.PlayChime()
Plays the Chime Sound.
Returns
Nothing
http://smallbasic.com/img/method_16.png PlayChimeAndWait
Sound.PlayChimeAndWait()
Plays the Chime Sound and waits for it to finish.
Returns
Nothing
http://smallbasic.com/img/method_16.png PlayChimes
Sound.PlayChimes()
Plays the Chimes Sound.
Returns
Nothing
http://smallbasic.com/img/method_16.png PlayChimesAndWait
Sound.PlayChimesAndWait()
Plays the Chimes Sound and waits for it to finish.
Returns
Nothing
http://smallbasic.com/img/method_16.png PlayBellRing
Sound.PlayBellRing()
Plays the Bell Ring Sound.
Returns
Nothing
http://smallbasic.com/img/method_16.png PlayBellRingAndWait
Sound.PlayBellRingAndWait()
Plays the Bell Ring Sound and waits for it to finish.
Returns
Nothing
http://smallbasic.com/img/method_16.png PlayMusic
Sound.PlayMusic(notes)
Plays musical notes.
notes
A set of musical notes to play. The format is a subset of the Music Macro Language supported by QBasic.
Returns
Nothing
http://smallbasic.com/img/method_16.png Play
Sound.Play(filePath)
Plays the Click Sound.
filePath
Returns
Nothing
http://smallbasic.com/img/method_16.png 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
http://smallbasic.com/img/method_16.png 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
http://smallbasic.com/img/method_16.png 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
See Also
- Small Basic: Reference Documentation
- The Developer’s Reference Guide to Small Basic
- Wiki: Small Basic Portal