mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
feat(audio): add spatial voice source with underwater effects
Update voice source to support spatial positioning, low-pass filter, and reverb effect for underwater immersion. Adjust source pool size and low-pass filter parameter. Correct receive_voice parameter type.
This commit is contained in:
@@ -48,7 +48,7 @@ public:
|
||||
void set_client(std::weak_ptr<NetworkClient> client);
|
||||
|
||||
void send_voice(const std::array<int16_t, AudioRecording::FRAME_SAMPLES>&);
|
||||
void receive_voice(std::span<char> opus, const glm::vec3& pos);
|
||||
void receive_voice(std::span<const char> opus, const glm::vec3& pos);
|
||||
|
||||
AudioRecording& audio_recording();
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "Cubed/audio/audio_effect_slot.hpp"
|
||||
#include "Cubed/audio/audio_filter.hpp"
|
||||
#include "glm/ext/vector_float3.hpp"
|
||||
|
||||
#include <al.h>
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
@@ -19,6 +23,15 @@ public:
|
||||
|
||||
void stop();
|
||||
bool is_playing() const;
|
||||
void reset();
|
||||
|
||||
void set_volume(float volume);
|
||||
void set_pitch(float pitch);
|
||||
void set_pos(glm::vec3 pos);
|
||||
void set_filter(const AudioFilter& filter);
|
||||
void clear_filter();
|
||||
void set_effect_slot(const AudioEffectSlot& slot);
|
||||
void clear_effect_slot();
|
||||
|
||||
private:
|
||||
ALuint m_source = 0;
|
||||
|
||||
Reference in New Issue
Block a user