1 parent
09a3a4fee3
commit
7b8dcd9f31
7 files changed
+133
-7
No files matched your search
@@ -128,6 +128,14 @@ namespace Void::TeamSpeak
|
||||
[[nodiscard]] Void::Result::Result<void, Error>
|
||||
sendWhisper(std::span<const std::uint8_t> opusFrame,
|
||||
const WhisperTargets& targets);
|
||||
[[nodiscard]] Void::Result::Result<VoiceStreamId, Error>
|
||||
createVoiceStream();
|
||||
[[nodiscard]] Void::Result::Result<void, Error>
|
||||
destroyVoiceStream(VoiceStreamId stream);
|
||||
[[nodiscard]] Void::Result::Result<void, Error>
|
||||
sendWhisper(VoiceStreamId stream,
|
||||
std::span<const std::uint8_t> opusFrame,
|
||||
const WhisperTargets& targets);
|
||||
void stopVoice() noexcept;
|
||||
|
||||
private:
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
@@ -107,6 +108,12 @@ namespace Void::TeamSpeak::Protocol
|
||||
void sendWhisper(std::span<const uint8_t> opus,
|
||||
const std::vector<uint64_t>& channelIds,
|
||||
const std::vector<uint16_t>& clientIds);
|
||||
[[nodiscard]] uint32_t createVoiceStream();
|
||||
[[nodiscard]] bool destroyVoiceStream(uint32_t streamId);
|
||||
[[nodiscard]] bool sendWhisper(
|
||||
uint32_t streamId, std::span<const uint8_t> opus,
|
||||
const std::vector<uint64_t>& channelIds,
|
||||
const std::vector<uint16_t>& clientIds);
|
||||
// End-of-voice marker (empty frame).
|
||||
void sendVoiceStop();
|
||||
|
||||
@@ -134,7 +141,8 @@ namespace Void::TeamSpeak::Protocol
|
||||
void loopThread();
|
||||
void handleIncomingPacket(std::span<const uint8_t> raw);
|
||||
void sendOutgoing(std::span<const uint8_t> data, PacketType type,
|
||||
uint8_t extraFlags = 0);
|
||||
uint8_t extraFlags = 0,
|
||||
std::optional<uint16_t> voiceId = std::nullopt);
|
||||
std::vector<uint8_t> buildRawPacket(std::span<const uint8_t> data,
|
||||
PacketType type,
|
||||
uint16_t packetId,
|
||||
@@ -192,6 +200,8 @@ namespace Void::TeamSpeak::Protocol
|
||||
|
||||
std::array<uint16_t, 9> packetCounter_{};
|
||||
std::array<uint32_t, 9> generationCounter_{};
|
||||
uint32_t nextVoiceStreamId_{1};
|
||||
std::map<uint32_t, uint16_t> voiceStreamCounters_;
|
||||
|
||||
bool cryptoInitComplete_ = false;
|
||||
std::vector<uint8_t> ivStruct_;
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace Void::TeamSpeak
|
||||
};
|
||||
|
||||
using ClientId = Id<struct ClientIdTag, std::uint16_t>;
|
||||
using VoiceStreamId = Id<struct VoiceStreamIdTag, std::uint32_t>;
|
||||
using ClientDatabaseId = Id<struct ClientDatabaseIdTag, std::uint64_t>;
|
||||
using ChannelId = Id<struct ChannelIdTag, std::uint64_t>;
|
||||
using ServerConnectionId = Id<struct ServerConnectionIdTag, std::uint64_t>;
|
||||
|
||||
Reference in new issue
Block a user