diff options
author | Gerald Begumisa <ben_g@users.sourceforge.net> | 2008-02-27 19:21:41 +0000 |
---|---|---|
committer | Gerald Begumisa <ben_g@users.sourceforge.net> | 2008-02-27 19:21:41 +0000 |
commit | 0937742d2f5689c93efca3a5a56e8b36f81152c7 (patch) | |
tree | a0c817c8b45c888c88d020583a45a5ec65a225dd /orkbasecxx/AudioCapture.h | |
parent | 9483156b326918005bb42751cc0e37a16b3e3e41 (diff) |
Added support for storage of stereo files - typically files containing 2 separate channels. Added the config.xml variable StereoRecording which needs to be set to true for this to work. Added another config.xml variable TapeNumChannels which should be set to 2 to test this. If TapeNumChannels is set to 1, default behaviour happens. Currently only 1 and 2 are the only supported values for TapeNumChannels.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@526 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkbasecxx/AudioCapture.h')
-rw-r--r-- | orkbasecxx/AudioCapture.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/orkbasecxx/AudioCapture.h b/orkbasecxx/AudioCapture.h index 1d6ae78..972e428 100644 --- a/orkbasecxx/AudioCapture.h +++ b/orkbasecxx/AudioCapture.h @@ -55,7 +55,8 @@ public: unsigned int m_sequenceNumber; unsigned int m_sampleRate; char m_rtpPayloadType; // -1 if none - unsigned char m_channel; // 0 if mono, 1 or 2 if stereo + unsigned char m_channel; // 0 if mono, 1 or 2 if stereo, 100 if we have + // separated multiple channels }; /** @@ -65,21 +66,31 @@ class DLL_IMPORT_EXPORT_ORKBASE AudioChunk { public: AudioChunk(); + AudioChunk(int numChannels); ~AudioChunk(); void ToString(CStdString&); + /** Creates n zeroed buffers where n=m_numChannels */ + void CreateMultiChannelBuffers(AudioChunkDetails& details); + /** Allocate a new empty buffer (zeroed) */ void* CreateBuffer(AudioChunkDetails& details); /** Copy external buffer to internal buffer. Create internal buffer if necessary */ void SetBuffer(void* pBuffer, AudioChunkDetails& details); + /** Copy external buffer to internal buffer. Create internal buffer if necessary */ + void SetBuffer(void* pBuffer, AudioChunkDetails& details, int chan); + /** Computes the Root-Mean-Square power value of the buffer */ double ComputeRms(); /** Compute the RMS decibel value of the buffer with a 0 dB reference being the maximum theoretical RMS power of the buffer (2^15) */ double ComputeRmsDb(); + /** Free's all memory allocated */ + void FreeAll(); + int GetNumSamples(); int GetNumBytes(); int GetSampleRate(); @@ -90,6 +101,12 @@ public: void * m_pBuffer; + //========================================================== + // Additions to support separate audio for multiple channels + + int m_numChannels; + void ** m_pChannelAudio; + private: AudioChunkDetails m_details; }; |