class MMAudio
Class that represents a background audio-file player.
class MMAudio
Name | Description |
---|---|
Constructors | |
MMAudio() | Creates a audio-file player. |
Properties | |
looping | Whether loop the media when EOF met. |
isPlaying | Whether the media is currently being played. |
duration | Duration of the media in seconds. |
position | Playback position of the current media in seconds. |
Methods | |
dispose() | Dispose the unmanaged resource. |
play() | Start playback of the media. |
pause() | Pause playback of the media. |
setPosition() | Apply seeking. |
setAudioDevice() | Change the audio-out device. |
Constructors
MMAudio()
MMAudio
(filename
: String, idx_audio_dev
: Number, speed
: Number)
Creates a audio-file player.
Parameters
filename
: url to local or http video source.
idx_audio_dev
: index of the audio-out device.
speed
: playback speed. Default 1.0.
Properties
looping
.looping
: Boolean
Whether loop the media when EOF met.
Readable and writable.
isPlaying
.isPlaying
: Boolean
Whether the media is currently being played.
Read-only.
duration
.duration
: Number
Duration of the media in seconds.
Read-only.
position
.position
: Number
Playback position of the current media in seconds.
Read-only.
Methods
dispose()
.dispose
(): undefined
Dispose the unmanaged resource.
play()
.play
(): undefined
Start playback of the media.
pause()
.pause
(): undefined
Pause playback of the media.
setPosition()
setPosition
(position
: Number): undefined
Apply seeking, set the current position (in secs) to position
.
setAudioDevice()
.setAudioDevice
(idx_audio_dev
: Number): undefined
Change the audio-out device.