Open 3D Engine AudioSystem Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Audio::MicrophoneRequests Class Referenceabstract

#include <MicrophoneBus.h>

Inherits AZ::EBusTraits.

Public Types

using MutexType = AZStd::recursive_mutex
 

Public Member Functions

virtual bool InitializeDevice ()=0
 
virtual void ShutdownDevice ()=0
 
virtual bool StartSession ()=0
 
virtual void EndSession ()=0
 
virtual bool IsCapturing ()=0
 
virtual SAudioInputConfig GetFormatConfig () const =0
 
virtual AZStd::size_t GetData (void **outputData, AZStd::size_t numFrames, const SAudioInputConfig &targetConfig, bool shouldDeinterleave)=0
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single
 
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single
 

Detailed Description

Interface for connecting with a hardware Microphone device. The pattern that should be used is as follows:

InitializeDevice StartSession (Capturing Mic Data...) EndSession ... (optional: additional StartSession/EndSession pairs) ... ShutdownDevice

Member Function Documentation

◆ EndSession()

virtual void Audio::MicrophoneRequests::EndSession ( )
pure virtual

Stop capturing Microphone data.

◆ GetData()

virtual AZStd::size_t Audio::MicrophoneRequests::GetData ( void **  outputData,
AZStd::size_t  numFrames,
const SAudioInputConfig targetConfig,
bool  shouldDeinterleave 
)
pure virtual

Consume a number of sample frames from the captured data.

Parameters
outputDataWhere the data will be copied to.
numFramesThe number of sample frames requested.
targetConfigThe configuration of the data sink (sample rate, channels, sample type, etc).
shouldDeinterleaveAsk for a deinterleaved copy when in stereo: [LRLRLRLR] --> [LLLL, RRRR]
Returns
The number of sample frames obtained.

◆ GetFormatConfig()

virtual SAudioInputConfig Audio::MicrophoneRequests::GetFormatConfig ( ) const
pure virtual

Obtain the format set up for the mic capture session.

Returns
Configuration of the Microphone.

◆ InitializeDevice()

virtual bool Audio::MicrophoneRequests::InitializeDevice ( )
pure virtual

Initialize a hardware Microphone input device with the OS.

Returns
True if the Microphone was initialized without errors, false otherwise.

◆ IsCapturing()

virtual bool Audio::MicrophoneRequests::IsCapturing ( )
pure virtual

Check if the Microphone is actively capturing data.

Returns
True if a capturing session has started and is running, false otherwise.

◆ ShutdownDevice()

virtual void Audio::MicrophoneRequests::ShutdownDevice ( )
pure virtual

Shutdown the connection to the Microphone device.

◆ StartSession()

virtual bool Audio::MicrophoneRequests::StartSession ( )
pure virtual

Start capturing Microphone data.

Returns
True if the Microphone capturing session was started without errors, false otherwise.

Member Data Documentation

◆ HandlerPolicy

const AZ::EBusHandlerPolicy Audio::MicrophoneRequests::HandlerPolicy = AZ::EBusHandlerPolicy::Single
static

EBus Traits


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