Sound Component
Properties
minimumInterval Specifies the minimum interval required between calls to Play, in milliseconds. Once the sound starts playing, all further Play calls will be ignored until the interval has elapsed.
Data type: number |
||
Designer Writable | true |
<sound name="soundName" minimumInterval="100"> |
Code Writeable | true |
soundName.minimumInterval = 100 |
Code Readable | true |
let variable = soundName.minimumInterval |
source The name of the sound file. Only certain formats are supported. See http://developer.android.com/guide/appendix/media-formats.html
Data type: string |
||
Designer Writable | true |
<sound name="soundName" source="/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/My Documents/Recordings/app_inventor_1675592812960.3gp"> |
Code Writeable | true |
soundName.source = "/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/My Documents/Recordings/app_inventor_1675592812960.3gp" |
Code Readable | true |
let variable = soundName.source |
class The styling class of the the component
Data type: string |
||
Designer Writable | true |
<sound name="soundName" class="Test class"> |
Code Writeable | false | |
Code Readable | false |
id The styling id of the the component
Data type: string |
||
Designer Writable | true |
<sound name="soundName" id="Test id"> |
Code Writeable | false | |
Code Readable | false |
name The name of the component that will be used to refer to it in code.
Data type: string |
||
Designer Writable | true |
<sound name="soundName" name="testComponent"> |
Code Writeable | false | |
Code Readable | false |
Methods
Method name | Description | Parameters | ||
---|---|---|---|---|
pause |
Pauses playing the sound if it is being played. soundName.pause() |
|
||
play |
Plays the sound. soundName.play() |
|
||
resume |
Resumes playing the sound after a pause. soundName.resume() |
|
||
stop |
Stops playing the sound if it is being played. soundName.stop() |
|
||
vibrate |
Vibrates for the specified number of milliseconds. soundName.vibrate(millisecs) soundName.vibrate(0) |
|