![]() |
|
#6
|
|||
|
|||
|
So changing the sound volume every frame with the volume computed by your algorithm won't work? I guess I'm missing something. But thats ok.
![]() Just for fun I added a slider controlling volume to the Vizard 3D sound example Code:
# WorldViz Copyright 2002====================================================
# This script demonstrates the use of 3D sound, otherwise known as spatialized
# sound. To mimic the sound changes that occur in real environments with
# real sounds, the computer will change the sound being played between the
# two speakers (or 4 speakers for fancy cards) to create the sense of spatialized
# sound. Vizard uses Microsoft Direct Sound as it's interface to this procedure,
# which in turn will use any 3D sound acceleration that is available on your
# sound card. As such, you'll have to turn to either Microsoft or your sound
# card manufacturer to try and figure out what is really going on. Good luck.
#
# In this demo, two objects are create by issuing the 'add' command. To
# attach a sound to an object, the child method command 'playsound' is called.
# Pressing the 'z' key in this demo causes one of the object to start orbiting
# around the origin.
#
#===========================================================================
import viz
import math
viz.go()
import vizinfo
info = vizinfo.add('This script demonstrates how to use 3D sound.\nA sound is being played from each object.\nUse the checkbox to toggle between spinning the object.\nMove closer to an object to hear each sound louder.')
SpinCheck = info.add(viz.CHECKBOX,'Spin Object')
SpinCheck.set(1)
SpinAction = vizact.spin(0,1,0,90)
volumeSlider = info.add(viz.SLIDER, 'volume')
viz.add('tut_ground.wrl')
m1 = viz.add('tut_hedra.wrl')
m2 = viz.add('tut_hedra.wrl')
m1Sound = m1.playsound('buzzer.wav', viz.LOOP)
m1.translate(-15, 0,15)
m2Sound = m2.playsound('boing!.wav', viz.LOOP)
m2.translate(-5, 0, 0)
m2.center(5,0,0)
m2.addAction(SpinAction)
vizact.onbuttondown(SpinCheck,m2.addAction,SpinAction)
vizact.onbuttonup(SpinCheck,m2.clearActions)
vizact.onslider(volumeSlider, m1Sound.volume)
vizact.onslider(volumeSlider, m2Sound.volume)
http://msdn.microsoft.com/en-us/libr...23(VS.85).aspx
__________________
Paul Elliott WorldViz LLC |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sound Looping Problem | JMOwens | Vizard | 4 | 09-29-2010 09:42 PM |
| HRTF-based spatial audio with Vizard? | bernie | Vizard | 4 | 10-16-2008 09:58 AM |
| On click Sound Play Problems | Robbos | Vizard | 1 | 02-28-2008 02:02 PM |
| Stuttering sound | Jerry | Vizard | 1 | 06-13-2007 12:36 PM |
| sound problem | alaa | Vizard | 7 | 09-02-2005 01:13 PM |