37 lines
1.0 KiB
C++
37 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include "core/runtime_state.h"
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
|
|
namespace borla {
|
|
|
|
class IVoiceFrameProcessor {
|
|
public:
|
|
virtual ~IVoiceFrameProcessor() = default;
|
|
virtual void ApplyPolicy(AudioPolicy policy) = 0;
|
|
virtual bool Process(
|
|
AudioPolicy policy,
|
|
const int16_t* input,
|
|
size_t sample_count,
|
|
int16_t* output,
|
|
size_t output_capacity) = 0;
|
|
};
|
|
|
|
class IPlaybackReferenceSink {
|
|
public:
|
|
virtual ~IPlaybackReferenceSink() = default;
|
|
virtual void OnPlaybackReference(
|
|
const int16_t* samples,
|
|
size_t sample_count) = 0;
|
|
// Called when a new playback session begins. Frames queued for the
|
|
// previous session are acoustically unrelated to what the microphone is
|
|
// about to hear, and leaving them in the ring offsets every reference by
|
|
// however many were stranded. Emptying it here phase-locks the reference
|
|
// stream to the session that is actually about to reach the speaker.
|
|
virtual void ResetPlaybackReference() = 0;
|
|
};
|
|
|
|
} // namespace borla
|