The Audio Player object provides the ability to setup the playing of a series of audio streams. The object accepts an array of content meta-data objects, describing the audio and providing url's for accessing each stream. The component understands the following streamformat values: "mp3", "wma", "mp4", "hls", "es.aac-adts", "flac"

Supported Interfaces

Supported Events

Description

This object does not provide an interface to a screen. In order to get events both from the screen you are using and the Audio Player, you should use the same Message Port for both objects. 
This object is created with no parameters:

  • CreateObject("roAudioPlayer")
Example
Sub Main()
	audioPlayer = CreateObject("roAudioPlayer")
	port = CreateObject("roMessagePort")
	audioPlayer.SetMessagePort(port)
	song = CreateObject("roAssociativeArray")
	song.url = "http://www.theflute.co.uk/media/BachCPE_SonataAmin_1.wma"
	audioplayer.addcontent(song)
	audioplayer.setloop(false)
	audioPlayer.play()
	while true
        	msg = wait(0, port)
        	if type(msg) = "roAudioPlayerEvent"
            		if msg.isStatusMessage() then
                		print "roAudioPlayerEvent: "; msg.getmessage()
                		if msg.getmessage() = "end of playlist" return
            		endif
        	endif
    	end while
End Sub