Rate this page:

IAudioFile

Interface that may be used to play audio files

Supported audio file formats are listed in the table

Methods

play

Copy URL

void

play(

boolean

loop
)

Start playing the audio file

Parameters

  • loop:

    boolean

    whether to loop or not

Returns

  • type:

    void

release

Copy URL

void

release()

Release all resources allocated for playing audio file.

Must be called even if the file was not played.

Returns

  • type:

    void

setAudioFileListener

Copy URL

void

setAudioFileListener(

IAudioFileListener

listener
)

Register a listener to be notified about events regarding audio file playing status.

Parameters

  • IAudioFileListener or null. If null, previous listener will be removed

Returns

  • type:

    void

stop

Copy URL

void

stop(

boolean

pause
)

Stop or pause playing the audio file.

If the file is paused, it is possible to continue to play it by calling IAudioFile.play from the position it has been stopped.

Parameters

  • pause:

    boolean

    whether to pause or stop

Returns

  • type:

    void