Closed xstater closed 2 years ago
tsclientlib contains code to send audio packets, but not to create them. You need to write that code yourself. I.e. read the wav file, encode it with some opus library like audiopus
, manage the timing on when to send packets, and send them off as audio packets with tsclientlib.
There is some example code in https://github.com/ReSpeak/tsclientlib/blob/master/tsclientlib/examples/audio.rs and https://github.com/ReSpeak/tsclientlib/blob/master/tsclientlib/examples/audio_utils/audio_to_ts.rs that captures microphone input with SDL and sends that (it doesn’t need to do any timing). If you’re looking for a bot to play music, you might find https://github.com/Splamy/TS3AudioBot interesting.
wow, thanks for for your response! I will look these documents
I want to build a simple bot to play some sound in my ts server. I noticed that there is a
ts3client_playWaveFile
api in ts SDK, but i didn't see the same api in tsclientlib. So how to do that ?