public VoiceGateway(GridClient c) { Client = c; sessions = new Dictionary <string, VoiceSession>(); position = new VoicePosition(); position.UpOrientation = new Vector3d(0.0, 1.0, 0.0); position.Velocity = new Vector3d(0.0, 0.0, 0.0); oldPosition = new Vector3d(0, 0, 0); oldAt = new Vector3d(1, 0, 0); slvoiceArgs = " -ll -1"; // Min logging slvoiceArgs += " -i 127.0.0.1:" + daemonPort.ToString(); // slvoiceArgs += " -lf " + control.instance.ClientDir; }
/// <summary> /// Set the combined speaking and listening position in 3D space. /// </summary> /// <param name="SessionHandle">Handle returned from successful Session ‘create’ request or a SessionNewEvent</param> /// <param name="SpeakerPosition">Speaking position</param> /// <param name="ListenerPosition">Listening position</param> /// <returns></returns> public int SessionSet3DPosition(string SessionHandle, VoicePosition SpeakerPosition, VoicePosition ListenerPosition) { StringBuilder sb = new StringBuilder(); sb.Append(VoiceGateway.MakeXML("SessionHandle", SessionHandle)); sb.Append("<SpeakerPosition>"); sb.Append("<Position>"); sb.Append(VoiceGateway.MakeXML("X", SpeakerPosition.Position.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", SpeakerPosition.Position.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", SpeakerPosition.Position.Z.ToString())); sb.Append("</Position>"); sb.Append("<Velocity>"); sb.Append(VoiceGateway.MakeXML("X", SpeakerPosition.Velocity.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", SpeakerPosition.Velocity.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", SpeakerPosition.Velocity.Z.ToString())); sb.Append("</Velocity>"); sb.Append("<AtOrientation>"); sb.Append(VoiceGateway.MakeXML("X", SpeakerPosition.AtOrientation.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", SpeakerPosition.AtOrientation.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", SpeakerPosition.AtOrientation.Z.ToString())); sb.Append("</AtOrientation>"); sb.Append("<UpOrientation>"); sb.Append(VoiceGateway.MakeXML("X", SpeakerPosition.UpOrientation.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", SpeakerPosition.UpOrientation.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", SpeakerPosition.UpOrientation.Z.ToString())); sb.Append("</UpOrientation>"); sb.Append("<LeftOrientation>"); sb.Append(VoiceGateway.MakeXML("X", SpeakerPosition.LeftOrientation.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", SpeakerPosition.LeftOrientation.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", SpeakerPosition.LeftOrientation.Z.ToString())); sb.Append("</LeftOrientation>"); sb.Append("</SpeakerPosition>"); sb.Append("<ListenerPosition>"); sb.Append("<Position>"); sb.Append(VoiceGateway.MakeXML("X", ListenerPosition.Position.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", ListenerPosition.Position.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", ListenerPosition.Position.Z.ToString())); sb.Append("</Position>"); sb.Append("<Velocity>"); sb.Append(VoiceGateway.MakeXML("X", ListenerPosition.Velocity.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", ListenerPosition.Velocity.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", ListenerPosition.Velocity.Z.ToString())); sb.Append("</Velocity>"); sb.Append("<AtOrientation>"); sb.Append(VoiceGateway.MakeXML("X", ListenerPosition.AtOrientation.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", ListenerPosition.AtOrientation.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", ListenerPosition.AtOrientation.Z.ToString())); sb.Append("</AtOrientation>"); sb.Append("<UpOrientation>"); sb.Append(VoiceGateway.MakeXML("X", ListenerPosition.UpOrientation.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", ListenerPosition.UpOrientation.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", ListenerPosition.UpOrientation.Z.ToString())); sb.Append("</UpOrientation>"); sb.Append("<LeftOrientation>"); sb.Append(VoiceGateway.MakeXML("X", ListenerPosition.LeftOrientation.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", ListenerPosition.LeftOrientation.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", ListenerPosition.LeftOrientation.Z.ToString())); sb.Append("</LeftOrientation>"); sb.Append("</ListenerPosition>"); return Request("Session.Set3DPosition.1", sb.ToString()); }
public void Set3DPosition(VoicePosition SpeakerPosition, VoicePosition ListenerPosition) { connector.SessionSet3DPosition(m_Handle, SpeakerPosition, ListenerPosition); }
/// <summary> /// Set the combined speaking and listening position in 3D space. /// </summary> /// <param name="SessionHandle">Handle returned from successful Session ‘create’ request or a SessionNewEvent</param> /// <param name="SpeakerPosition">Speaking position</param> /// <param name="ListenerPosition">Listening position</param> /// <returns></returns> public int SessionSet3DPosition(string SessionHandle, VoicePosition SpeakerPosition, VoicePosition ListenerPosition) { StringBuilder sb = new StringBuilder(); sb.Append(VoiceGateway.MakeXML("SessionHandle", SessionHandle)); sb.Append("<SpeakerPosition>"); sb.Append("<Position>"); sb.Append(VoiceGateway.MakeXML("X", SpeakerPosition.Position.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", SpeakerPosition.Position.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", SpeakerPosition.Position.Z.ToString())); sb.Append("</Position>"); sb.Append("<Velocity>"); sb.Append(VoiceGateway.MakeXML("X", SpeakerPosition.Velocity.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", SpeakerPosition.Velocity.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", SpeakerPosition.Velocity.Z.ToString())); sb.Append("</Velocity>"); sb.Append("<AtOrientation>"); sb.Append(VoiceGateway.MakeXML("X", SpeakerPosition.AtOrientation.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", SpeakerPosition.AtOrientation.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", SpeakerPosition.AtOrientation.Z.ToString())); sb.Append("</AtOrientation>"); sb.Append("<UpOrientation>"); sb.Append(VoiceGateway.MakeXML("X", SpeakerPosition.UpOrientation.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", SpeakerPosition.UpOrientation.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", SpeakerPosition.UpOrientation.Z.ToString())); sb.Append("</UpOrientation>"); sb.Append("<LeftOrientation>"); sb.Append(VoiceGateway.MakeXML("X", SpeakerPosition.LeftOrientation.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", SpeakerPosition.LeftOrientation.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", SpeakerPosition.LeftOrientation.Z.ToString())); sb.Append("</LeftOrientation>"); sb.Append("</SpeakerPosition>"); sb.Append("<ListenerPosition>"); sb.Append("<Position>"); sb.Append(VoiceGateway.MakeXML("X", ListenerPosition.Position.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", ListenerPosition.Position.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", ListenerPosition.Position.Z.ToString())); sb.Append("</Position>"); sb.Append("<Velocity>"); sb.Append(VoiceGateway.MakeXML("X", ListenerPosition.Velocity.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", ListenerPosition.Velocity.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", ListenerPosition.Velocity.Z.ToString())); sb.Append("</Velocity>"); sb.Append("<AtOrientation>"); sb.Append(VoiceGateway.MakeXML("X", ListenerPosition.AtOrientation.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", ListenerPosition.AtOrientation.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", ListenerPosition.AtOrientation.Z.ToString())); sb.Append("</AtOrientation>"); sb.Append("<UpOrientation>"); sb.Append(VoiceGateway.MakeXML("X", ListenerPosition.UpOrientation.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", ListenerPosition.UpOrientation.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", ListenerPosition.UpOrientation.Z.ToString())); sb.Append("</UpOrientation>"); sb.Append("<LeftOrientation>"); sb.Append(VoiceGateway.MakeXML("X", ListenerPosition.LeftOrientation.X.ToString())); sb.Append(VoiceGateway.MakeXML("Y", ListenerPosition.LeftOrientation.Y.ToString())); sb.Append(VoiceGateway.MakeXML("Z", ListenerPosition.LeftOrientation.Z.ToString())); sb.Append("</LeftOrientation>"); sb.Append("</ListenerPosition>"); return(Request("Session.Set3DPosition.1", sb.ToString())); }
public VoiceGateway(GridClient c) { Random rand = new Random(); daemonPort = rand.Next(34000, 44000); Client = c; sessions = new Dictionary<string, VoiceSession>(); position = new VoicePosition(); position.UpOrientation = new Vector3d(0.0, 1.0, 0.0); position.Velocity = new Vector3d(0.0, 0.0, 0.0); oldPosition = new Vector3d(0, 0, 0); oldAt = new Vector3d(1, 0, 0); slvoiceArgs = " -ll -1"; // Min logging slvoiceArgs += " -i 127.0.0.1:" + daemonPort.ToString(); // slvoiceArgs += " -lf " + control.instance.ClientDir; }
public VoiceGateway(GridClient c) { Client = c; sessions = new Dictionary<string, VoiceSession>(); position = new VoicePosition(); position.UpOrientation = new Vector3d(0.0, 1.0, 0.0); position.Velocity = new Vector3d(0.0, 0.0, 0.0); oldPosition = new Vector3d(0, 0, 0); oldAt = new Vector3d(1, 0, 0); slvoiceArgs = "-c"; // Cleanup old instances slvoiceArgs += " -ll -1"; // Min logging slvoiceArgs += " -i 0.0.0.0:" + daemonPort.ToString(); // slvoiceArgs += " -lf " + control.instance.ClientDir; }