Player APIs (BrightScript & Ja...
...
Object Reference
Presentation and Widget Object...

roAudioPlayerMx

8min
this object allows you to mix audio files, as well as hls audio streams each roaudioplayermx object contains two internal audio players the main audio playlist consists of queued audio tracks that play sequentially, while the audio overlay plays files on top of the main playlist a fade will not occur if it is called while an overlay is playing, but the next audio track will start playing as expected tracks are queued to playfile() with their fade parameters specified in an roassociativearray docid\ sb0om1y oqlapfqnfs0xy these are the parameters you can pass to playfile() filename the filename of the track frontporch the length (in milliseconds) to skip from the start of the track this value is 0 by default fadeoutlocation the location (in milliseconds) of the fade out relative to the value of the frontporch if the frontporch value is 0 (which is the default setting), and the fadeoutlength value is non zero, then the fade out is calculated back from the end of the file fadeoutlength the length of the fade out (in milliseconds) this value is 0 by default seguelocation the location (in milliseconds) of the event that triggers the next audio file to play this location is relative to the first audio file that is played if the seguelocation parameter is not included, the value defaults to the fadeoutlocation backporchlocation the location (in milliseconds) of the termination point for the audio track this location is relative to the first audio file that is played if the backporchlocation parameter is not included, the audio file plays to the end the value is 0 by default, which disables the back porch trackvolume the relative volume of of the audio track, measured as a percentage specify the percentage using values between 0 and 100 eventid the id for an audio event eventtimestamp the timestamp for the audio event there can only be one event per audio file queuenext the queuing of an audio track set the parameter value to 1 to queue an audio file to play after the current track overlay the overlay specification of an audio track set the parameter value to 1 to fade down the main audio playlist while playing the audio track as an overaly overlays have additional parameters audiobedlevel the volume level percentage of the main audio playlist while the overlay is playing specify the percentage using values between 0 and 100 audiobedfadeoutlength the fade out length of the main audio playlist audiobedfadeinlength the fade in lenth for the length of the underlying audio track once the segue is triggered fadecurrentplaynext a fade command set the parameter value to 1 to fade out the current main audio playlist track and fade in the designated audio file crossfadecurrentplaynext a crossfade command set the parameter value to 1 to force an immediate crossfade between the current main audio playlist track and the designated audio file userstring a string that can be set to a unique value for each roaudioplayermx instance this string is returned with every event generated by the instance since all current platforms can support multiple roaudioplayermx instances running at the same time, the userstring allows the script to distinguish between event returns the following diagram illustrates how some of these timing parameters work together the following script illustrates a simple crossfade between audio tracks a = createobject("roaudioplayermx") track1 = createobject("roassociativearray") track1\["filename"] = "file1 mp3" track1\["fadeinlength"] = 4000 track1\["fadeoutlength"] = 4000 track1\["queuenext"] = 1 track2 = createobject("roassociativearray") track2\["filename"] = "file2 mp3" track2\["fadeinlength"] = 4000 track2\["fadeoutlength"] = 4000 track2\["queuenext"] = 1 a playfile(track1) a playfile(track2) ifmediatransport see rovideoplayer for a description of ifmediatransport methods ifaudiocontrol see roaudioplayer for a description of ifaudiocontrol methods ifsetmessageport setport(a as object) ifuserdata setuserdata(user data as object) sets the user data that will be returned when events are raised getuserdata() as object returns the user data that has previously been set via setuserdata() it will return invalid if no data has been set ifidentity getidentity() as integer the ifidentity interface has been deprecated we recommend using the ifuserdata interface instead ifaudiocontrolmx setdecodercount(a as integer) as boolean