WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Control volume with slider (https://forum.worldviz.com/showthread.php?t=1849)

djones1010 02-28-2009 09:24 PM

Control volume with slider
 
I am currently working the Options page of my project.
I am having some trouble controlling the volume with a slider.
The desired result I want is to increase and decrease in volume and with each movement of the tick and have the sound play back with the change value for volume.

Could someone help me or give me a few hints?

Thanks

DBurks2818 03-01-2009 06:28 PM

Here's something my team made for our game:

Quote:

song = viz.add('[insert song].mp3')
song.play()
song.volume(1.0)

viz.clearcolor(0.5,0.5,1)

def myslider(obj, pos):
song.volume(0.8*pos)

viz.callback(viz.SLIDER_EVENT,myslider)
I couldn't quite get it at first either, but it turned out to be pretty simple.


All times are GMT -7. The time now is 01:47 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC