Audio

Plays the audio file using the device's audio player.

If more than one audio object instance is created and their of_play function is called, then more than one audio file is being played at the same time. This could happen if the window is closed without destroying the audio instance (so the audio is still being played), and then when the window is opened again, the audio instance is created again.

Supported on iOS device only.

eon_mobile_audioex

Properties
integer ii_errorcode

Error code which is returned when the oe_error event is triggered.

powerobject ipo_bindevent

The object to bind with the oe_error event.

string is_bindwitherrorevent

The name of the event bound with the oe_error event of the powerobject ipo_bindevent.

string is_errortext

Error message which is returned when the oe_error event is triggered.

Events
oe_error

Description

It will be triggered automatically if there is an error when using the audio functionality.

Supported on iOS device only.

Note: This event will update the value of is_errortext and ii_errorcode properties.

Syntax

None.

Return value

None.

Functions
of_getstatus

Description

Gets the current status of the audio file.

Supported on iOS device only.

Syntax

audio.of_getstatus ( )

Argument Type

Argument

Description

eon_mobile_audioex

audio

The name of the eon_mobile_audioex object.

Return value

Integer.

0 - The audio file is stopped.

1 - The audio file is being played.

2 - The audio file is paused.

-1 - It is called in PowerBuilder, PowerServer Web, or Android, or there is an error.

of_pauseorresume

Description

Pauses the audio file that is being played or resumes playing it from where it stopped.

Supported on iOS device only.

Syntax

audio.of_pauseorresume ( )

Argument Type

Argument

Description

eon_mobile_audioex

audio

The name of the eon_mobile_audioex object.

Return value

Integer.

1 - The audio file is paused successfully.

-1 - It is called in PowerBuilder, PowerServer Web, or Android, or there is an error.

of_play

Description

Uses the default audio player application to play the audio file.

The supported audio file formats are .aac, .mp3, .aiff, and .wav. Not all the audio files with these suffixes can be played; if some media files cannot be played, they should be transcoded first via iTunes.

Supported on iOS device only.

Syntax

audio.of_play ( string as_filepath )

Argument Type

Argument

Description

eon_mobile_audioex

audio

The name of the eon_mobile_audioex object.

string as_filepath The full path of the audio file to be played.

Return value

Integer.

1 - The audio file is played successfully.

-1 - It is called in PowerBuilder, PowerServer Web, or Android, or there is an error.

of_register

Description

Registers the object and the event to be bound with the oe_error event.

Supported on iOS device only.

Syntax

audio.of_register ( powerobject apb_bind, string as_error )

Argument Type

Argument

Description

eon_mobile_audioex

audio

The name of the eon_mobile_audioex object.

powerobject apb_bind The object to be bound with the oe_error event.
string as_error The event to be bound with the oe_error event.

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder, PowerServer Web, or Android, or there is an error.

of_stop

Description

Stops the audio file that is being played.

Supported on iOS device only.

Syntax

audio.of_stop ( )

Argument Type

Argument

Description

eon_mobile_audioex

audio

The name of the eon_mobile_audioex object.

Return value

Integer.

1 - The audio file is stopped successfully.

-1 - It is called in PowerBuilder, PowerServer Web, or Android, or there is an error.

of_triggerevent

Description

Triggers the object event bound with the oe_error event.

Supported on iOS device only.

Syntax

audio.of_triggerevent ( string as_event )

Argument Type

Argument

Description

eon_mobile_audioex

audio

The name of the eon_mobile_audioex object.

string as_event The event name bound with oe_error event.

Return value

None