Manevolent / ts3j

An open-source Java Teamspeak 3 client library using the TS3 full client protocol
Apache License 2.0
107 stars 15 forks source link

Can´t connect to a Teamspeak Server #1

Closed CodeStrings closed 6 years ago

CodeStrings commented 6 years ago

I first tried with the test example in ServerConnectionTest, that worked great for me with the example Teamspeak Server, as soon as I try any other TeamSpeak I can´t connect and get a timeout, while waiting for the CONNECTED state

Manevolent commented 6 years ago

You may want to set Ts3Debugging stuff to on, project is kindof funny with how that's all set up but it may give you some insight as to why that is happening in the form of a stack trace. Sounds like an INIT packet is failing and going unanswered somewhere.

With the right params it should work, I haven't had a whole lot of time to test but it is working excellently right now as a simple audio bot right now as a plugin for the chatbot I have.

Be sure to set an identity and client name before connecting; that's where I would start

CodeStrings commented 6 years ago

Thanks for the answer, After selecting the direct IP it worked ;) But another Bug that I found is that you cant view the Information about the Client the Debug shows no Packet is defined for that and also the Windows Version is not shown correctly ;( And is it also possible to make a Voice Packet with a size over 500?

Manevolent commented 6 years ago

OK so that sounds like TSDNS? I haven't done that part yet so that would explain it.

Oh and, right now I haven't implemented the client info... it'll just show retrieving right now but it's doing no harm stability wise, just a tad weird.

You can't send a voice packet over 500 bytes, well technically you could if you would compress it first, but ideally you want to segment your voice data into, well, packets. What I'm doing is I'm using an Opus wrapper for Java, and encoding 20ms at a time. Then, I implement the interface and report OPUS_MUSIC as the type, and when provide() is called I simply offer up an encoding of the 20ms of audio, which for Opus Music (stereo) is 960 samples/shorts/floats per channel (48,000Hz/"samples a sec" times 0.020/20ms) or something like that. If you want the code I can probably push up a test for that too.

We don't have to live by the channel audio setting at ALL, which is awesome. Teamspeak doesn't enforce it, it's more of a suggestion you can follow or not. So, you could in theory just support Opus Music as your output format to the server, and you'd be fine forever.

CodeStrings commented 6 years ago

Would Be nice if I could get the Code ;) My Problem is that I would like to directly Stream the Music from YouTube, because I want to achieve a minimal load. But when I try that the Packets are like 300-700 big. Maybe we can Write in Discord: Yonathan#5560. I tried sending it every 20ms but I get a little stutter, so that wont work for me, only if I use 19ms it works :/. And also I have to go down to 24,000Hz 480 Samples to get the Packet size under 500

Update: Got everything fixed with the VoicePacket now I will try to figure out how to make the ConnectionInformation visible :P

Manevolent commented 6 years ago

Well unless it's a code change in ts3j I think you will run into trouble, I don't think you willt be able to see the notification command/event pop by since I sort of filter those out from the command handler part of the code. What I need to do is gander through Splamy's (gold standard for TS3 client) code and see how they did it.

I did just send you a request, I'll try to massage the code I have and hook you up with the audio player I have, its frontend is PCM as a float array and it spits out a jitter-free stream to TS