Forum

Results 1 to 13 of 13
  1. #1
    Join Date
    July 2013
    Posts
    7

    Question ts3client_systemset3DListenerAttributes not works?

    Hello everyone.
    I am trying to use 3D positioining API on TS 3.0.10.1 I have 3d audio enabled and in according to documentation I do something like this:
    Code:
    void ts3plugin_onClientMoveEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, const char* moveMessage) {
    	int errorCode;
    	TS3_VECTOR myPosition;
    	TS3_VECTOR hisPosition;
    
    	myPosition.x = 20.0f;
    	myPosition.z = 20.0f;
    	myPosition.y = 10.0f;
    
    	hisPosition.x = 30.0f;
    	hisPosition.y = 30.0f;
    	hisPosition.z = 30.0f;
    	
    	if(clientID == myID) 
    	{		
    
    		errorCode = ts3Functions.systemset3DListenerAttributes(serverConnectionHandlerID, &myPosition, NULL, NULL); 
    		if(errorCode != ERROR_ok)
    		{
    			printf("DEBUG: Failed to set own 3d position. Error code %d\n", errorCode);
    		}
    		else
    		{
    			printf("DEBUG: OWN 3D POSITION SET.\n");
    		}
    	}
    	else
    	{		
    			errorCode = ts3Functions.channelset3DAttributes(serverConnectionHandlerID, clientID, &hisPosition);
    			if(errorCode != ERROR_ok)
    			{
    				printf("DEBUG: Failed to set remote clients 3d position. Error code %d\n", errorCode);
    			}
    			else
    			{
    				printf("DEBUG: REMOTE CLIENT 3D POSITION SET.\n");
    			}
    	}
    }
    Then I move me and other client to some channel - all calls to API return success (for my and client positions). But looks like API calls not affects 3D location - I can't hear any change in sound. Also, positions are not updated on "Setup 3D Sound" screen.
    But I can hear difference in case of manual setting 3D positions "Setup 3D Sound" screen.

    So, is API supposed to work this way? Or maybe I doing something wrong?

    Thanks a lot.

    PS
    Windows 7 x64, tested on both 32 and 64 versions of TS 3.0.10.1

    UPDATE:
    If I close "Setup 3D Sound" screen (after pressing apply, without my plugin loaded) TS clears all 3D settings (user shown at same location and no 3D effect )....
    Last edited by michail.nikolaev; July 7th, 2013 at 11:25 PM. Reason: updated some info

  2. #2
    Join Date
    July 2013
    Posts
    7
    Have anyone experience with systemset3DListenerAttributes? ...

  3. #3
    Join Date
    October 2012
    Location
    Germany
    Posts
    553
    See question 1. You'll have to manually enable the 3d Module. Both the "channel 3d sound" thingie and the playback option point to the very same global variable. That's only the beginning of the fun involved. Note also, that if you're planning to bring a game in there, you could also do the approach of Minecraft Mod, an app that "does what it has to do" to enable both Teamspeak support via CrossTalk as well as "thou shall not be named here".

  4. #4
    Join Date
    July 2013
    Posts
    7
    Quote Originally Posted by Philosound View Post
    See question 1. You'll have to manually enable the 3d Module. Both the "channel 3d sound" thingie and the playback option point to the very same global variable. That's only the beginning of the fun involved.
    Thanks, I have seen your post. I have 3D enabled (via "channel 3d sound" and via "Always use 3d Positions when avaiable" in playback settings). But it looks like systemset3DListenerAttributes and channelset3DAttributes are just ignored by TS...

    Have you use it?

  5. #5
    Join Date
    October 2012
    Location
    Germany
    Posts
    553
    Well, yes. That's what CrossTalks Positional Audio module is using. In retrospective though, I'd better opted for using an own VBAP implementation I think.

    Iirc you'll have to do systemset3DSettings once to have it working at all too.
    Last edited by Chris; July 10th, 2013 at 09:50 AM.

  6. #6
    Join Date
    July 2013
    Posts
    7
    Thanks, I have seen sources of CrossTalk already (from github) - but I can't see any call to the systemset3DListenerAttributes ... Maybe in some older version?

    Quote Originally Posted by Philosound View Post
    Iirc you'll have to do systemset3DSettings once to have it working at all too.
    I call ts3Functions.systemset3DSettings(serverConnectionH andlerID, 1.0f, 1.0f); before any other 3D-related calls. But I can't see any effect of it..
    Last edited by Chris; July 10th, 2013 at 09:51 AM.

  7. #7
    Join Date
    October 2012
    Location
    Germany
    Posts
    553
    That's because the Positional Audio module ain't open source for now

    I'm calling it inside the module onConnectStatusChanged when state is connection established, then I'm done with it in the current implementation.

  8. #8
    Join Date
    July 2013
    Posts
    7
    Quote Originally Posted by Philosound View Post
    That's because the Positional Audio module ain't open source for now
    .



    Quote Originally Posted by Philosound View Post
    I'm calling it inside the module onConnectStatusChanged when state is connection established
    .
    I do it the same way.

    I'll try again and reply with results. I'll also try to use 3D positioning of CrossTalk on my PC - maybe problem in it.
    But could you please confirm that code provided by me in first uses API in correct way?

  9. #9
    Join Date
    October 2012
    Location
    Germany
    Posts
    553
    Hm, then there doesn't seem anything really wrong with that, other than something the code snippet might not show. myID is in fact accessible? onClientMoveEvent used like that will need you to switch channels to fuel it up, since iirc it isn't called when joining the default channel on connect.

  10. #10
    Join Date
    July 2013
    Posts
    7
    Yes, myID is correct. Also I switching channels by both clients to get onClientMoveEvent fired..

    I have one small idea: I run 2 instances of TS to test - maybe it is breaks something in static variables of TS....

  11. #11
    Join Date
    October 2012
    Location
    Germany
    Posts
    553
    Hm, no idea about that. When I need multiple clients I just connect to the same server with multiple tabs (which also tells me if my stuff is supporting multiple tabs properly).

  12. #12
    Join Date
    July 2013
    Posts
    7
    Thanks you, got it worked.
    Problem was in
    ts3plugin_onCustom3dRolloffCalculationClientEvent
    For some reason TS not calcuates values for volume (leaves always 1.0).

  13. #13
    Join Date
    October 2012
    Location
    Germany
    Posts
    553
    That might be me overwriting the value, I have no check at this callback if I should be in charge at that moment.
    Will add a check for supported-game-running && module active for the next update.
    Last edited by Philosound; July 10th, 2013 at 12:37 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: December 23rd, 2011, 02:15 AM
  2. works sometimes
    By CAPTAINBILL in forum Windows
    Replies: 0
    Last Post: June 9th, 2011, 09:30 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •