group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
VoiceCapture Class Reference

#include <VoiceCapture.hpp>

Collaboration diagram for VoiceCapture:
[legend]

Classes

struct  EncodedFrame

Public Member Functions

bool init (std::string_view recordingDeviceName={})
void quit ()
void setRecordingDeviceName (std::string_view name)
void setPushToTalk (bool active)
bool ready () const noexcept
bool transmitting () const noexcept
std::vector< EncodedFramepoll ()

Private Member Functions

bool framePassesNoiseGate (std::span< const float > frame) const noexcept

Private Attributes

SDL_AudioStream * captureStream_ = nullptr
VoiceEncoder encoder_
std::string recordingDeviceName_
std::vector< float > capturePcm_
std::size_t captureReadOffset_ = 0
std::uint16_t nextSequence_ = 0
bool transmitting_ = false

Static Private Attributes

static constexpr int kFrameSamples = net::voice::k_sampleRate * net::voice::k_frameMs / 1000
static constexpr std::size_t kMaxAccumulatedSamples = static_cast<std::size_t>(kFrameSamples * 8)

Member Function Documentation

◆ framePassesNoiseGate()

bool VoiceCapture::framePassesNoiseGate ( std::span< const float > frame) const
nodiscardprivatenoexcept
Here is the caller graph for this function:

◆ init()

bool VoiceCapture::init ( std::string_view recordingDeviceName = {})
Here is the call graph for this function:
Here is the caller graph for this function:

◆ poll()

std::vector< VoiceCapture::EncodedFrame > VoiceCapture::poll ( )
nodiscard
Here is the call graph for this function:

◆ quit()

void VoiceCapture::quit ( )
Here is the caller graph for this function:

◆ ready()

bool VoiceCapture::ready ( ) const
inlinenodiscardnoexcept
Here is the caller graph for this function:

◆ setPushToTalk()

void VoiceCapture::setPushToTalk ( bool active)
Here is the caller graph for this function:

◆ setRecordingDeviceName()

void VoiceCapture::setRecordingDeviceName ( std::string_view name)
Here is the call graph for this function:

◆ transmitting()

bool VoiceCapture::transmitting ( ) const
inlinenodiscardnoexcept

Member Data Documentation

◆ capturePcm_

std::vector<float> VoiceCapture::capturePcm_
private

◆ captureReadOffset_

std::size_t VoiceCapture::captureReadOffset_ = 0
private

◆ captureStream_

SDL_AudioStream* VoiceCapture::captureStream_ = nullptr
private

◆ encoder_

VoiceEncoder VoiceCapture::encoder_
private

◆ kFrameSamples

int VoiceCapture::kFrameSamples = net::voice::k_sampleRate * net::voice::k_frameMs / 1000
staticconstexprprivate

◆ kMaxAccumulatedSamples

std::size_t VoiceCapture::kMaxAccumulatedSamples = static_cast<std::size_t>(kFrameSamples * 8)
staticconstexprprivate

◆ nextSequence_

std::uint16_t VoiceCapture::nextSequence_ = 0
private

◆ recordingDeviceName_

std::string VoiceCapture::recordingDeviceName_
private

◆ transmitting_

bool VoiceCapture::transmitting_ = false
private

The documentation for this class was generated from the following files: