17 #include <ht_component.h> 18 #include <ht_jsonhelper.h> 19 #include <ht_audio_resource.h> 20 #include <ht_audiosource.h> 21 #include <ht_audiobuffer.h> 48 virtual Core::JSON VSerialize()
override;
49 virtual bool VDeserialize(
const Core::JSON& jsonObject)
override;
51 virtual void VOnInit()
override;
52 virtual void VOnUpdate()
override;
54 virtual Component* VClone()
const override;
56 virtual Core::Guid VGetComponentId(
void)
const override;
58 void PlayAudio(Resource::AudioResourceHandle handle);
61 virtual void VOnEnabled()
override;
62 virtual void VOnDisabled()
override;
63 virtual void VOnDestroy()
override;
66 static constexpr
size_t numBuffers = 16;
68 Resource::AudioResourceHandle m_currentAudioHandle;
70 stb_vorbis* m_audioStream;
71 Audio::Source m_source;
72 std::array<Audio::Buffer, numBuffers> m_bufferList;
73 size_t m_nextBufferIndex;
75 void SetupBuffer(Audio::Buffer& audioBuffer);
76 bool SetupAudioStream();
Definition: ht_audiosource_component.h:38
Definition: ht_component.h:42
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Definition: ht_glfwkeyboard.h:21