<< Click to Display Table of Contents >> Navigation: 3. Script Language > Multimedia Commands > Multimedia Commands |
MiniRobotLanguage (MRL)
MPA. Command
Music Player
Intention
MPA. is a "Music Player". You give it a piece of Sound, and it will play it.
Simple Example:
MPA.MySong.mp3
MPA. can also accept a List of Audio Files (Play-List).
The Songs must be separated using a ">" Sign. Example:
MPA.MySong.mp3>MySong2.mp3>MySong3.mp3
Of course this makes more sense using a variable:
$$PLI=MySong.mp3>MySong2.mp3>MySong3.mp3
MPA.$$PLI
You can add a third parameter to test if a file can be played or not.
Example:
$$LID=?pfad\Neu Textdatei.mp3
MPA.$$LID|$$RES
STS.DUMP
MBX.$$RES
The Music-Player will not pop up any error-messages, instead place all errors whether in this variable or on TOS, if no variable is given.
Some Hints:
• Use MPB. in case the Music should play in the background
• Use SVL. to change the Overall Volume and the Mute-State
• Use MPC. and MPB. for Sound effect like faster or slower Playback rate etc.
Syntax
MPA.[P1][|P2]
Parameter Explanation
P1 - Filename or Playlist (=Filenames, separated with ">")
P2 - (optional) Variable, receives Error-Messages if there
are Errors during playback.
Example
'***********************************
' MPA.-Sample
'***********************************
' Repeat a Song endless
DOL.1
MPA.MySong.mp3
OOP.
END.
Remarks
-
Limitations:
This command makes use of the Windows "Direct Show" API. If Direct X / Direct Show is not installed on the target PC, these commands will not work. If you have a working Windows Media Player,on the system, then everything will work as expected. Generally all Audio-Formats, that are supported with the Windows Media Player, should work with this command also.
See also:
• MPB. - Music Play Background