Last Updated On 2021-07-16
Version 4MinSDK 7Tutorial Video
A multimedia component that plays sound files and optionally vibrates for the number of milliseconds (thousandths of a second) specified in the Blocks Editor. The name of the sound file to play can be specified either in the Designer or in the Blocks Editor.
For supported sound file formats, see Android Supported Media Formats.
Sound component is best for short sound files, such as sound effects, while the
Player component is more efficient for longer sounds, such as songs.
You might get an error if you attempt to play a sound immeditely after setting the source.
You can set the below properties in the UI part of the builder.
- MinimumInterval - it's a non negative integer value which is set to 500 by default.
- Source - it's a asset value which is set to blank by default.
You can set the below blocks properties in the blocks section of the builder.
The minimum interval, in milliseconds, between sounds. If you play a sound, all further Play() calls will be ignored until the interval has elapsed.
The name of the sound file. Only certain formats are supported. See http://developer.android.com/guide/appendix/media-formats.html.
You can set the below method blocks in the blocks section of the builder.
Pauses playing the sound if it is being played.
Plays the sound specified by the Source property.
Resumes playing the sound after a pause.
Stops playing the sound if it is being played.
Vibrates for the specified number of milliseconds.
You can set the below event blocks in the blocks section of the builder.
The SoundError event is no longer used. Please use the Screen.ErrorOccurred event instead.