Open 3D Engine AudioEngineWwise 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::AudioInputFile Class Reference

#include <AudioInputFile.h>

Inherits Audio::AudioInputSource.

Public Member Functions

 AudioInputFile (const SAudioInputConfig &sourceConfig)
 
bool LoadFile ()
 
void UnloadFile ()
 
void ReadInput (const AudioStreamData &data) override
 
void WriteOutput (AkAudioBuffer *akBuffer) override
 
bool IsOk () const override
 
void OnDeactivated () override
 
size_t CopyData (size_t numSampleFrames, void *toBuffer)
 
- Public Member Functions inherited from Audio::AudioInputSource
virtual void ReadInput (const AudioStreamData &data)=0
 
virtual void WriteOutput (AkAudioBuffer *akBuffer)=0
 
virtual bool IsOk () const =0
 
virtual bool IsFormatValid () const
 
virtual void OnActivated ()
 
virtual void OnDeactivated ()
 
void SetFormat (AkAudioFormat &format)
 
void SetSourceId (TAudioSourceId sourceId)
 
TAudioSourceId GetSourceId () const
 

Additional Inherited Members

- Protected Attributes inherited from Audio::AudioInputSource
SAudioInputConfig m_config
 Configuration information for the source type.
 
AkPlayingID m_playingId = AK_INVALID_PLAYING_ID
 Playing ID of the source.
 

Detailed Description

A type of AudioInputSource representing an audio file. Contains audio file data, holds a pointer to the raw data and provides methods to read chunks of data at a time to an output (AkAudioBuffer).

Member Function Documentation

◆ CopyData()

size_t Audio::AudioInputFile::CopyData ( size_t  numSampleFrames,
void *  toBuffer 
)

Copy data from the internal buffer to an output buffer. Copies a specified number of sample frames to an output buffer. If more frames are requested than can be copied, only allowable frames are copied and number of frames that were copied is returned.

Parameters
numSampleFramesNumber of sample frames requested for copy.
toBufferOutput buffer to copy to.
Returns
Number of sample frames actually copied.

◆ IsOk()

bool Audio::AudioInputFile::IsOk ( ) const
overridevirtual

◆ LoadFile()

bool Audio::AudioInputFile::LoadFile ( )

Load file into buffer. Use an AudioFileParser if needed to parse header information, then proceed to load the audio data to the internal buffer.

Returns
True upon successful load, false otherwise.

◆ OnDeactivated()

void Audio::AudioInputFile::OnDeactivated ( )
overridevirtual

Reimplemented from Audio::AudioInputSource.

◆ ReadInput()

void Audio::AudioInputFile::ReadInput ( const AudioStreamData &  data)
overridevirtual

◆ UnloadFile()

void Audio::AudioInputFile::UnloadFile ( )

Unload the file data. Release the internal buffer of file data.

◆ WriteOutput()

void Audio::AudioInputFile::WriteOutput ( AkAudioBuffer *  akBuffer)
overridevirtual

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