bolar_2 backup
This commit is contained in:
36
main/audio/voice_frame_processor.h
Normal file
36
main/audio/voice_frame_processor.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user