3
0

MicrophoneSystemComponent_None.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <MicrophoneSystemComponent.h>
  9. namespace Audio
  10. {
  11. ///////////////////////////////////////////////////////////////////////////////////////////////
  12. // Null Implementation of a Microphone
  13. class MicrophoneSystemComponentNone : public MicrophoneSystemComponent::Implementation
  14. {
  15. public:
  16. AZ_CLASS_ALLOCATOR(MicrophoneSystemComponentNone, AZ::SystemAllocator);
  17. bool InitializeDevice() override
  18. {
  19. return true;
  20. }
  21. void ShutdownDevice() override
  22. {
  23. }
  24. bool StartSession() override
  25. {
  26. return true;
  27. }
  28. void EndSession() override
  29. {
  30. }
  31. bool IsCapturing() override
  32. {
  33. return false;
  34. }
  35. SAudioInputConfig GetFormatConfig() const override
  36. {
  37. return m_config;
  38. }
  39. AZStd::size_t GetData(void**, AZStd::size_t, const SAudioInputConfig&, bool) override
  40. {
  41. return 0;
  42. }
  43. private:
  44. SAudioInputConfig m_config;
  45. };
  46. ///////////////////////////////////////////////////////////////////////////////////////////////
  47. MicrophoneSystemComponent::Implementation* MicrophoneSystemComponent::Implementation::Create()
  48. {
  49. return aznew MicrophoneSystemComponentNone();
  50. }
  51. } // namespace Audio