
46
set_volume: Volume functions as a percentage and therefore takes a value between 0-100. The volume value is clipped
prior to use (i.e. SetVoume(101) will set the volume to 100 and return True). The volume is the same for all mapped
outputs and USB/SPDIF/analog.
Note: Separate volume levels are stored for roAudioPlayer and roVideoPlayer.
set_channel_volumes: You can control the volume of individual audio channels. This volume command takes a hex
channel mask, which determines the channels to apply the volume to, and a level, which is a percentage of the full scale.
The volume control works according to audio channel rather than the output. The channel mask is a bit mask with the
following bits for MP3 output:
• &H01 Left
• &H02 Right
• &H03 Both left and right
Example: This code sets audio output to the rightmost expansion moduleaudio port.
video = CreateObject("roVideoPlayer")
video.SetAudioOutput(0)
video.MapStereoOutput(3)
Example: This code sets the volume level for individual channels.
audio = CreateObject("roAudioPlayer")
audio.SetChannelVolumes(&H01, 60) ‘left channel to 60%
audio.SetChannelVolumes(&H02, 75) ‘right channel to 75%
Comentarios a estos manuales