mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-17 17:27:19 +02:00
Each remote drone's motor is synthesised and played through the game's positioned voice sound, the one proximity chat uses, so it is placed in the world and muffled behind walls. The throttle is worked out from how the drone accelerates, so the drone packet and protocol stay the same. Full volume only within 1.5 m, heard out to 120 m; the DRONE page's sound volume sets the level.
24 lines
956 B
C++
24 lines
956 B
C++
#pragma once
|
|
#include "native_voice_pcm.h"
|
|
#include <memory>
|
|
|
|
namespace dingosdk::multiplayer {
|
|
class NativeVoicePlayback {
|
|
public:
|
|
// Players' voices; other sounds played this way (remote drones) take their own tag, so their
|
|
// streams never share an id with a voice's in the game's one sample provider.
|
|
static constexpr std::uint64_t voice_source_tag = 0x52534b5600000000ULL; // "RSKV"
|
|
explicit NativeVoicePlayback(std::uint64_t source_tag = voice_source_tag);
|
|
~NativeVoicePlayback();
|
|
bool available() const noexcept;
|
|
void reset(std::uint64_t generation);
|
|
void remove(std::uint64_t id, std::uint64_t generation);
|
|
void position(std::uint64_t id, std::uint64_t generation, const std::array<float, 3> &, float gain);
|
|
bool submit(std::uint64_t id, std::uint64_t generation, std::span<const std::uint8_t>);
|
|
void process(std::uintptr_t base) noexcept;
|
|
private:
|
|
struct Impl;
|
|
std::unique_ptr<Impl> impl_;
|
|
};
|
|
}
|