OgreOggSound  1.26
OgreOggSound::OgreOggSoundRecord Class Reference

Captures audio data. More...

#include <OgreOggSoundRecord.h>

Public Types

typedef std::vector< Ogre::StringRecordDeviceList
 

Public Member Functions

 OgreOggSoundRecord (ALCdevice &alDevice)
 
const RecordDeviceListgetCaptureDeviceList ()
 
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
 
RecordDeviceList mDeviceList
 
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. NOTE:- default file properties are - Frequency: 44.1Khz, Format: 16-bit stereo, Buffer Size: 8820 bytes.

Member Typedef Documentation

Constructor & Destructor Documentation

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

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

Member Function Documentation

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.
void OgreOggSound::OgreOggSoundRecord::_updateRecording ( )
private

Updates recording from the capture device

const RecordDeviceList& OgreOggSound::OgreOggSoundRecord::getCaptureDeviceList ( )

Gets a list of strings describing the capture devices

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

bool OgreOggSound::OgreOggSoundRecord::isCaptureAvailable ( )

Returns whether a capture device is available

void OgreOggSound::OgreOggSoundRecord::startRecording ( )

Starts a recording from a capture device

void OgreOggSound::OgreOggSoundRecord::stopRecording ( )

Stops recording from the capture device

Friends And Related Function Documentation

friend class OgreOggSoundManager
friend

Member Data Documentation

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

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