BVB Source Codes

CRYENGINE Show VoiceController.h Source code

Return Download CRYENGINE: download VoiceController.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef __VOICECONTROLLER_H__
  4. #define __VOICECONTROLLER_H__
  5.  
  6. #pragma once
  7.  
  8. #ifndef OLD_VOICE_SYSTEM_DEPRECATED
  9.  
  10.         #include "ISound.h"
  11.  
  12. class CGameContext;
  13.  
  14. class CVoiceController
  15. {
  16. public:
  17.         CVoiceController(CGameContext* pGameContext);
  18.         ~CVoiceController();
  19.         bool Init();
  20.         void Enable(const bool e);
  21.         void PlayerIdSet(EntityId id);
  22.  
  23.         void GetMemoryStatistics(ICrySizer* s)
  24.         {
  25.                 s->Add(*this);
  26.         }
  27. private:
  28.         IMicrophone* m_pMicrophone;
  29.         INetContext* m_pNetContext;
  30.         bool         m_enabled;
  31.         bool         m_recording;
  32.  
  33.         struct CDataReader : public IVoiceDataReader
  34.         {
  35.                 CDataReader()
  36.                 {
  37.                         m_pMicrophone = 0;
  38.                 }
  39.  
  40.                 IMicrophone* m_pMicrophone;
  41.  
  42.                 virtual bool Update()
  43.                 {
  44.                         if (m_pMicrophone)
  45.                         {
  46.                                 m_pMicrophone->Update();
  47.                                 return true;
  48.                         }
  49.                         else
  50.                                 return false;
  51.                 }
  52.  
  53.                 virtual uint32 GetSampleCount()
  54.                 {
  55.                         return m_pMicrophone ? m_pMicrophone->GetDataSize() / 2 : 0;
  56.                 }
  57.  
  58.                 virtual int16* GetSamples()
  59.                 {
  60.                         return m_pMicrophone ? m_pMicrophone->GetData() : 0;
  61.                 }
  62.         };
  63.  
  64.         CDataReader m_DataReader;
  65. };
  66.  
  67. #endif
  68.  
  69. #endif
  70.  
downloadVoiceController.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top