22.12.2013 Views

Roku Object Reference - imaginArt

Roku Object Reference - imaginArt

Roku Object Reference - imaginArt

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• MapStereoOutputAux (mapping)<br />

• SetVolumeAux (volume)<br />

• SetChannelVolumesAux (channel_mask, volume)<br />

The following functions control which specific streams are played<br />

• SetAudioStream (stream_index)<br />

• SetAudioStreamAux (stream_index)<br />

The stream_index is the index of the audio stream within the program stream to be played. A value of -1<br />

indicates that the first audio stream found within the multiplex will be played.<br />

Example: This code plays a video with the main audio stream over SPDIF/HDMI and the auxiliary<br />

stream to an analog port:<br />

video=Create<strong>Object</strong>("roVideoPlayer")<br />

video.SetAudioStream(0)<br />

video.SetAudioOutput(3)<br />

video.SetAudioStreamAux(1)<br />

video.SetAudioOutputAux(0)<br />

video.PlayFile("TwoStreams.mpg")<br />

Example: This code shows how to play a video with multiple languages:<br />

REM – select language from first audio track<br />

video.SetAudioStream(0)<br />

video.PlayFile("Language.mpg")<br />

REM – select language from second audio track<br />

video.SetAudioStream(1)<br />

video.PlayFile("Language.mpg")<br />

Because the streams to be played are specified prior to playing the file, there are some rules necessary as to<br />

what happens if the streams selected are invalid:<br />

• If the main stream is set to -1 then the first audio stream found within the multiplex will be played.<br />

• If the main stream is not -1 but is invalid, then no stream will be played. The aux stream will also be<br />

disabled in this case.<br />

• If the aux stream is -1 or invalid, then no audio will be played out of the aux output.<br />

17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!