Audio: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Brendon (talk | contribs)
No edit summary
Brendon (talk | contribs)
No edit summary
Line 1: Line 1:
[[file:Audio.jpg]]
[[file:Audio.jpg]]


'''Description'''
== Description ==


The Audio control is used to play a sound. The sound can be any common format, including mp3, ogg, wav and aac.  
The Audio control is used to play a sound. The sound can be any common format, including mp3, ogg, wav and aac.  
Line 7: Line 7:
To add a sound to your app, choose the Audio icon in the Toolbar, then position it on the Design Screen. Use the Property Editor to set the properties you need. Depending on the options you choose, the control may be invisible.
To add a sound to your app, choose the Audio icon in the Toolbar, then position it on the Design Screen. Use the Property Editor to set the properties you need. Depending on the options you choose, the control may be invisible.


'''Properties'''
== Properties ==


Standard [[properties and methods|properties]] are supported, plus:
Standard [[properties and methods|properties]] are supported, plus:
Line 23: Line 23:
|}
|}


'''Methods'''
== Methods ==
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 31: Line 31:
|}
|}


'''Example'''
== Example ==


<pre>
<pre>
REM Audio Example
Rem Audio Example
Function PlayButton_onclick()
Function PlayButton_onclick()
   Audio1.play
   Audio1.play
Line 40: Line 40:
</pre>
</pre>


'''Output'''
== Output ==


<pre>
<pre>
(sound plays)
(sound plays)
</pre>
</pre>
[[Category:Language Reference]]

Revision as of 04:40, 17 August 2012

Description

The Audio control is used to play a sound. The sound can be any common format, including mp3, ogg, wav and aac.

To add a sound to your app, choose the Audio icon in the Toolbar, then position it on the Design Screen. Use the Property Editor to set the properties you need. Depending on the options you choose, the control may be invisible.

Properties

Standard properties are supported, plus:

autoplay Audio will start playing as soon as ready.
controls Controls will be displayed, such as a Play.
loop Audio will start over again when finished.
preload Audio should be loaded when the page loads. Ignored if autoplay is present.
src The name of the file. For example, Super.wav. It should be in the project folder.

Methods

pause() Pause playing the sound
play() Start playing the sound

Example

Rem Audio Example
Function PlayButton_onclick()
  Audio1.play
End Function

Output

(sound plays)