Ogre Video and Audio Plugins  master
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Modules Pages
OgreOggSound::OgreOggSoundRecord Class Reference

Captures audio data. More...

#include <OgreOggSoundRecord.h>

Public Member Functions

 OgreOggSoundRecord (ALCdevice &alDevice)
 
bool initCaptureDevice (const Ogre::String &devName="", const Ogre::String &fileName="output.wav", ALCuint freq=44100, ALCenum format=AL_FORMAT_STEREO16, ALsizei bufferSize=8820)
 
void startRecording ()
 
bool isCaptureAvailable ()
 
void stopRecording ()
 
 ~OgreOggSoundRecord ()
 

Private Member Functions

void _updateRecording ()
 
bool _openDevice ()
 

Private Attributes

ALCdevice * mDevice
 
ALCcontext * mContext
 
ALCdevice * mCaptureDevice
 
const ALCchar * mDefaultCaptureDevice
 
ALint mSamplesAvailable
 
std::ofstream mFile
 
ALchar * mBuffer
 
WAVEHEADER mWaveHeader
 
ALint mDataSize
 
ALint mSize
 
Ogre::String mOutputFile
 
Ogre::String mDeviceName
 
ALCuint mFreq
 
ALCenum mFormat
 
ALsizei mBufferSize
 
unsigned short mBitsPerSample
 
unsigned short mNumChannels
 
bool mRecording
 

Friends

class OgreOggSoundManager
 

Detailed Description

Captures audio data.

Remarks
This class can be used to capture audio data to an external file, WAV file ONLY.
Use control panel --> Sound and Audio devices applet to select input type and volume.
Default file properties are - Frequency: 44.1Khz, Format: 16-bit stereo, Buffer Size: 8820 bytes.
Note
This class should be instantiated by using the OgreOggSoundManager::createRecorder() function.

Constructor & Destructor Documentation

◆ OgreOggSoundRecord()

OgreOggSound::OgreOggSoundRecord::OgreOggSoundRecord ( ALCdevice &  alDevice)

Creates an instance of the class used to manage sound recording with OpenAL.

Note
This class is intended to be instanced by calling OgreOggSoundManager::createRecorder().

◆ ~OgreOggSoundRecord()

OgreOggSound::OgreOggSoundRecord::~OgreOggSoundRecord ( )

Closes capture device, outputs captured data to a file if available.

Member Function Documentation

◆ _openDevice()

bool OgreOggSound::OgreOggSoundRecord::_openDevice ( )
private

Initialises a capture device ready to record audio data

Remarks
Gets a list of capture devices, initialises one, and opens output file for writing to.

◆ _updateRecording()

void OgreOggSound::OgreOggSoundRecord::_updateRecording ( )
private

Updates recording from the capture device

◆ initCaptureDevice()

bool OgreOggSound::OgreOggSoundRecord::initCaptureDevice ( const Ogre::String devName = "",
const Ogre::String fileName = "output.wav",
ALCuint  freq = 44100,
ALCenum  format = AL_FORMAT_STEREO16,
ALsizei  bufferSize = 8820 
)

Creates a capture object

◆ isCaptureAvailable()

bool OgreOggSound::OgreOggSoundRecord::isCaptureAvailable ( )

Returns whether the ALC_EXT_CAPTURE extension is available for the OpenAL implementation being used

◆ startRecording()

void OgreOggSound::OgreOggSoundRecord::startRecording ( )

Starts a recording from a capture device

◆ stopRecording()

void OgreOggSound::OgreOggSoundRecord::stopRecording ( )

Stops recording from the capture device

Friends And Related Function Documentation

◆ OgreOggSoundManager

friend class OgreOggSoundManager
friend

Member Data Documentation

◆ mBitsPerSample

unsigned short OgreOggSound::OgreOggSoundRecord::mBitsPerSample
private

◆ mBuffer

ALchar* OgreOggSound::OgreOggSoundRecord::mBuffer
private

◆ mBufferSize

ALsizei OgreOggSound::OgreOggSoundRecord::mBufferSize
private

◆ mCaptureDevice

ALCdevice* OgreOggSound::OgreOggSoundRecord::mCaptureDevice
private

◆ mContext

ALCcontext* OgreOggSound::OgreOggSoundRecord::mContext
private

◆ mDataSize

ALint OgreOggSound::OgreOggSoundRecord::mDataSize
private

◆ mDefaultCaptureDevice

const ALCchar* OgreOggSound::OgreOggSoundRecord::mDefaultCaptureDevice
private

◆ mDevice

ALCdevice* OgreOggSound::OgreOggSoundRecord::mDevice
private

◆ mDeviceName

Ogre::String OgreOggSound::OgreOggSoundRecord::mDeviceName
private

◆ mFile

std::ofstream OgreOggSound::OgreOggSoundRecord::mFile
private

◆ mFormat

ALCenum OgreOggSound::OgreOggSoundRecord::mFormat
private

◆ mFreq

ALCuint OgreOggSound::OgreOggSoundRecord::mFreq
private

◆ mNumChannels

unsigned short OgreOggSound::OgreOggSoundRecord::mNumChannels
private

◆ mOutputFile

Ogre::String OgreOggSound::OgreOggSoundRecord::mOutputFile
private

◆ mRecording

bool OgreOggSound::OgreOggSoundRecord::mRecording
private

◆ mSamplesAvailable

ALint OgreOggSound::OgreOggSoundRecord::mSamplesAvailable
private

◆ mSize

ALint OgreOggSound::OgreOggSoundRecord::mSize
private

◆ mWaveHeader

WAVEHEADER OgreOggSound::OgreOggSoundRecord::mWaveHeader
private

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