Class

iOSSound


Warning

This item was deprecated in version 2020r2. Please use Sound as a replacement.

Description

Plays sounds.

Properties

Name

Type

Read-Only

Shared

IsPlaying

Boolean

Pan

Integer

Volume

Integer

Methods

Name

Parameters

Returns

Shared

Clone

iOSSound

Constructor

file As FolderItem

Play

PlayLooping

Stop

Property descriptions


iOSSound.IsPlaying

IsPlaying As Boolean

Indicates if the sound is currently playing.

This property is read-only.


iOSSound.Pan

Pan As Integer

Specifies the relative volume (balance) between the left and right sound channels.

The value ranges from -100 to +100, with 0 indicating equal volume in both channels. -100 plays sound in only the left channel, 100 plays sound only in the right channel.


iOSSound.Volume

Volume As Integer

Specifies the volume level of the sound. Default = 100.

The value ranges from 0 to 100. A value of 0 mutes the sound and a value of 100 plays the sound at the "normal" volume set in the OS volume settings.

Lower the sound volume:

mySound.Volume = 50

Method descriptions


iOSSound.Clone

Clone As iOSSound

Creates a clone of the current sound that can be used independently of the original.


iOSSound.Constructor

Constructor(file As FolderItem)

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates a new sound from a sound file.

Plays a sound from the Documents folder:

Var soundFile As FolderItem
soundFile = SpecialFolder.Documents.Child("MySound.mp3")
Var mySound As New iOSSound(soundFile)
mySound.Play

iOSSound.Play

Play

Plays the sound once.

Plays a sound:

mySound.Play

iOSSound.PlayLooping

PlayLooping

Plays the sound, repeating it indefinitely.


iOSSound.Stop

Stop

Stops the sound from playing.

Notes

Supported iOS audio formats:

Format Name

Filename Extension

AIFF

.aif, .aiff

CAF

.caf

MPEG-1, layer 3

.mp3

MPEG-2 or MPEG-4 ADTS

.mp4

MPEG-4

.m4a, .mp4

WAV

.wav

Compatibility

iOS projects on the iOS operating system.