WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-27-2009, 12:36 PM
GiudiceLab GiudiceLab is offline
Member
 
Join Date: May 2009
Location: Orono, ME
Posts: 49
Trouble with listener updating position?

We have a script that toggles an object to play a sound whenever the viewpoint orientation is within a certain threshold (so when the person is looking at the object). It works very well until the viewpoint translates--If the person moves, then turns in place and looks at an object, the sound will trigger, but it will be spatialized as though the person was still in their original position. The stranger part is that if they move at all from their current position, the sound jumps to the correct location.

We are using keyboard commands to emulate orientation and position tracking. I have code snippets that cover the basics of this issue, but I am not sure if I included everything pertinent.
Code:
(in a separate module, called onupdate)

if viz.iskeydown(viz.KEY_LEFT):
   VIEW.rotate(0,1,0,-TURN_SPEED*viz.elapsed(),viz.HEAD_ORI,viz.REL_PARENT)
elif viz.iskeydown(viz.KEY_RIGHT):
   VIEW.rotate(0,1,0,TURN_SPEED*viz.elapsed(),viz.HEAD_ORI,viz.REL_PARENT)

if viz.iskeydown('w'):
   VIEW.translate(0,0,MOVE_SPEED*viz.elapsed(),viz.REL_LOCAL)
elif viz.iskeydown('s'):
   VIEW.translate(0,0,-MOVE_SPEED*viz.elapsed(),viz.REL_LOCAL)
elif viz.iskeydown('a'):
   VIEW.translate(-MOVE_SPEED*viz.elapsed(),0,0,viz.REL_LOCAL)
elif viz.iskeydown('d'):
   VIEW.translate(MOVE_SPEED*viz.elapsed(),0,0,viz.REL_LOCAL)

(in the experimental module, called onupdate)
def monitorOri(e):
	global objplay
	# the purpose of this function is to determine whether the viewpoint
	# is facing an object (within a certain threshold)
	# then have that object play its tone until the viewpoint moves outside
	# the threshold
	view_yaw = view.getEuler()
	view_pos = view.getPosition()

	for item in range(len(objects)):

		object_pos = objects[item].getPosition()
		target_angle = utilities.genTargetAngle(object_pos,view_pos)
		relative_angle = abs(vizmat.AngleDiff(target_angle,view_yaw[0]))
		
		if  (relative_angle <= threshold_angle) and objplay[item] == False:
			toggleTone(item,viz.ON)
			objplay[item] = True
		elif (relative_angle > threshold_angle) and objplay[item] == True:
			toggleTone(item,viz.OFF)
			objplay[item] = False
		else:
			pass
I use vizact onupdate to call the keystroke monitoring in the module, but use viz.callback(viz.UPDATE_EVENT, monitorOri) for monitoring the orientation with respect to each object. Maybe that is causing some sort of interference?

Any suggestions are appreciated, thanks.
__________________
Virtual Environments and Multimodal Interaction (VEMI) Lab

This time, it should work...
Reply With Quote
  #2  
Old 10-29-2009, 01:25 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I don't fully understand the problem. Do you have a simple script that recreates the issue? Also, are you using the default 3d sound plugin (DirectX)?
Reply With Quote
  #3  
Old 10-29-2009, 02:05 PM
GiudiceLab GiudiceLab is offline
Member
 
Join Date: May 2009
Location: Orono, ME
Posts: 49
I will create a sample script for you shortly. We are using the default DirectSound algorithm.
__________________
Virtual Environments and Multimodal Interaction (VEMI) Lab

This time, it should work...
Reply With Quote
  #4  
Old 10-29-2009, 02:36 PM
GiudiceLab GiudiceLab is offline
Member
 
Join Date: May 2009
Location: Orono, ME
Posts: 49
Sample script

I've attached a sample script that seems to replicate the problem. I used the 'quack.wav' file because I assumed you would be able to access it, but if you need a copy of the sound file, let me know.

What I am hoping you will notice is that if you walk toward an object (in this case a soccerball), the sound functions seem to work fine--for instance, the sound gets louder as you approach the object, and quieter when you move away. But if you then stop and rotate toward the other objects, the sound spatialization seems inaccurate until you translate the viewpoint. So you might move several meters, but still have an object sound as though it is right next to you, or the sound might only come from one side even when the object is directly in front of you.

I'm hoping it is something simple that I've overlooked. Thanks.
Attached Files
File Type: zip sample3dtest.zip (1.5 KB, 1781 views)
__________________
Virtual Environments and Multimodal Interaction (VEMI) Lab

This time, it should work...
Reply With Quote
  #5  
Old 10-30-2009, 10:19 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I'm still not sure I understand what the problem is. When I turn towards an object it plays a sound and the volume of the sound seems to adjust properly based on the distance to the object. I navigated next to the red ball and the sound was loud. Then I turned towards the yellow ball, which was further away, and the sound was quieter.
Reply With Quote
  #6  
Old 11-02-2009, 09:28 AM
GiudiceLab GiudiceLab is offline
Member
 
Join Date: May 2009
Location: Orono, ME
Posts: 49
After I read your post, I realized that I had not tried this script with our other headphones. I ran it just now and I can't replicate the problem with our wired headphones; it seems only the wireless headset has the issue, so that must be why you are not noticing any difference. We are using a Creative HS-1200 Wireless headset. Does this give you any idea about what might be happening?
__________________
Virtual Environments and Multimodal Interaction (VEMI) Lab

This time, it should work...
Reply With Quote
  #7  
Old 11-03-2009, 10:05 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I was using a Logitech wireless headset when testing your script. If the problem only occurs with your wireless headset, then it might be an issue with the sound driver. Have your tried updating the drivers?
Reply With Quote
  #8  
Old 11-05-2009, 12:40 PM
GiudiceLab GiudiceLab is offline
Member
 
Join Date: May 2009
Location: Orono, ME
Posts: 49
I'm glad you mentioned the Logitech; I had forgotten that we had a wireless Logitech headset, so I dragged it out of the cupboard, and once again failed to replicate the issue. So I'll use that one for my experiment. I did update the Creative drivers, but I still have the issue with that headset. Puzzling.
__________________
Virtual Environments and Multimodal Interaction (VEMI) Lab

This time, it should work...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
updating positional data Saz Vizard 8 01-12-2009 05:23 AM
writing joystick position to a data file Saz Vizard 3 12-17-2008 06:18 AM
default start position erchrastil Vizard 2 06-23-2008 09:15 AM
position of html-file on screen active_world Vizard 1 05-16-2008 08:24 PM
Avatar always returns in initial position pattie Vizard 2 08-31-2006 09:15 PM


All times are GMT -7. The time now is 11:29 PM.


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