UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FVoiceCaptureWindows Class Reference

#include <VoiceCaptureWindows.h>

+ Inheritance diagram for FVoiceCaptureWindows:

Public Member Functions

 FVoiceCaptureWindows ()
 
 ~FVoiceCaptureWindows ()
 
virtual bool Init (const FString &DeviceName, int32 SampleRate, int32 NumChannels) override
 
virtual void Shutdown () override
 
virtual bool Start () override
 
virtual void Stop () override
 
virtual bool ChangeDevice (const FString &DeviceName, int32 SampleRate, int32 NumChannels) override
 
virtual bool IsCapturing () override
 
virtual EVoiceCaptureState::Type GetCaptureState (uint32 &OutAvailableVoiceData) const override
 
virtual EVoiceCaptureState::Type GetVoiceData (uint8 *OutVoiceBuffer, uint32 InVoiceBufferSize, uint32 &OutAvailableVoiceData) override
 
virtual EVoiceCaptureState::Type GetVoiceData (uint8 *OutVoiceBuffer, uint32 InVoiceBufferSize, uint32 &OutAvailableVoiceData, uint64 &OutSampleCounter) override
 
virtual int32 GetBufferSize () const override
 
virtual void DumpState () const override
 
virtual float GetCurrentAmplitude () const override
 
virtual bool Tick (float DeltaTime) override
 
- Public Member Functions inherited from IVoiceCapture
virtual ~IVoiceCapture ()
 
Audio::FPatchOutputStrongPtr GetMicrophoneAudio (int32 MaxExpectedLatencyInSamples, float Gain)
 
- Public Member Functions inherited from TSharedFromThis< IVoiceCapture >
TSharedRef< IVoiceCapture, Mode > AsShared ()
 
TSharedRef< IVoiceCapture const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< IVoiceCapture, Mode > AsWeak ()
 
TWeakPtr< IVoiceCapture const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 
- Public Member Functions inherited from FTSTickerObjectBase
 UE_NONCOPYABLE (FTSTickerObjectBase)
 
CORE_API FTSTickerObjectBase (float InDelay=0.0f, FTSTicker &Ticker=FTSTicker::GetCoreTicker())
 
virtual CORE_API ~FTSTickerObjectBase ()
 

Additional Inherited Members

- Protected Member Functions inherited from IVoiceCapture
 IVoiceCapture ()
 
- Protected Member Functions inherited from TSharedFromThis< IVoiceCapture >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 
- Static Protected Member Functions inherited from TSharedFromThis< IVoiceCapture >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 
- Protected Attributes inherited from IVoiceCapture
Audio::FPatchSplitter MicrophoneOutput
 

Detailed Description

Windows implementation of voice capture using DirectSound

Constructor & Destructor Documentation

◆ FVoiceCaptureWindows()

FVoiceCaptureWindows::FVoiceCaptureWindows ( )

◆ ~FVoiceCaptureWindows()

FVoiceCaptureWindows::~FVoiceCaptureWindows ( )

Member Function Documentation

◆ ChangeDevice()

virtual bool FVoiceCaptureWindows::ChangeDevice ( const FString &  DeviceName,
int32  SampleRate,
int32  NumChannels 
)
overridevirtual

Change the associated capture device

Parameters
DeviceNamename of device to capture audio data with, empty for default device
SampleRatesampling rate of voice capture
NumChannelsnumber of channels to capture
Returns
true if change was successful, false otherwise

Implements IVoiceCapture.

◆ DumpState()

virtual void FVoiceCaptureWindows::DumpState ( ) const
overridevirtual

Dump the state of the voice capture device

Implements IVoiceCapture.

◆ GetBufferSize()

virtual int32 FVoiceCaptureWindows::GetBufferSize ( ) const
overridevirtual
Returns
number of bytes currently allocated in the capture buffer

Implements IVoiceCapture.

◆ GetCaptureState()

virtual EVoiceCaptureState::Type FVoiceCaptureWindows::GetCaptureState ( uint32 OutAvailableVoiceData) const
overridevirtual

Return the state of the voice data and its availability

Parameters
OutAvailableVoiceDatasize, in bytes, of available voice data
Returns
state of the voice capture buffer

Implements IVoiceCapture.

◆ GetCurrentAmplitude()

virtual float FVoiceCaptureWindows::GetCurrentAmplitude ( ) const
overridevirtual
Returns
the current loudness of the microphone. Returns -1.0 if this function is not supported by the current platform.

Reimplemented from IVoiceCapture.

◆ GetVoiceData() [1/2]

virtual EVoiceCaptureState::Type FVoiceCaptureWindows::GetVoiceData ( uint8 OutVoiceBuffer,
uint32  InVoiceBufferSize,
uint32 OutAvailableVoiceData 
)
overridevirtual

Fill a buffer with all available voice data

Parameters
OutVoiceBufferallocated buffer to fill with voice data
InVoiceBufferSizesize, in bytes, of allocated buffer
OutAvailableVoiceDatasize, in bytes, of data placed in the OutVoiceBuffer
OutSampleCounteroptional parameter for beginning sample of this buffer.
Returns
state of the voice capture buffer

Reimplemented from IVoiceCapture.

◆ GetVoiceData() [2/2]

virtual EVoiceCaptureState::Type FVoiceCaptureWindows::GetVoiceData ( uint8 OutVoiceBuffer,
uint32  InVoiceBufferSize,
uint32 OutAvailableVoiceData,
uint64 OutSampleCounter 
)
overridevirtual

Reimplemented from IVoiceCapture.

◆ Init()

virtual bool FVoiceCaptureWindows::Init ( const FString &  DeviceName,
int32  SampleRate,
int32  NumChannels 
)
overridevirtual

Initialize the voice capture object

Parameters
DeviceNamename of device to capture audio data with, empty for default device
SampleRatesampling rate of voice capture
NumChannelsnumber of channels to capture
Returns
true if successful, false otherwise

Implements IVoiceCapture.

◆ IsCapturing()

virtual bool FVoiceCaptureWindows::IsCapturing ( )
overridevirtual

Is the voice capture object actively capturing

Returns
true if voice is being captured, false otherwise

Implements IVoiceCapture.

◆ Shutdown()

virtual void FVoiceCaptureWindows::Shutdown ( )
overridevirtual

Shutdown the voice capture object

Implements IVoiceCapture.

◆ Start()

virtual bool FVoiceCaptureWindows::Start ( )
overridevirtual

Start capturing voice

Returns
true if successfully started, false otherwise

Implements IVoiceCapture.

◆ Stop()

virtual void FVoiceCaptureWindows::Stop ( )
overridevirtual

Stop capturing voice

Implements IVoiceCapture.

◆ Tick()

virtual bool FVoiceCaptureWindows::Tick ( float  DeltaTime)
overridevirtual

Pure virtual that must be overloaded by the inheriting class.

Parameters
DeltaTimetime passed since the last call.
Returns
true if should continue ticking

Implements FTSTickerObjectBase.


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