god knows whats diff but audio is sort of working ish

This commit is contained in:
Glence 2022-09-27 23:57:11 +08:00
parent 3c3b6a285b
commit 7fcac5e0eb
8 changed files with 66 additions and 54 deletions

Binary file not shown.

Binary file not shown.

BIN
Assets/Audio/Music.bank Normal file

Binary file not shown.

BIN
Assets/Audio/SFX.bank Normal file

Binary file not shown.

BIN
Assets/Audio/testogg.ogg Normal file

Binary file not shown.

BIN
Assets/Audio/testwave.wav Normal file

Binary file not shown.

View File

@ -79,12 +79,13 @@ namespace SHADE
LoadBank("../../Assets/Audio/Master.bank");
LoadBank("../../Assets/Audio/Master.strings.bank");
//LoadBank("resources/audio/banks/Music.bank");
//LoadBank("resources/audio/banks/SFX.bank");
LoadBank("../../Assets/Audio/Music.bank");
LoadBank("../../Assets/Audio/SFX.bank");
//auto clip = CreateAudioClip("event:/SFX/Dawn/Dawn_Attack");
//auto clip = CreateAudioClip("event:/Characters/sfx_footsteps_human");
//clip->Play();
//PlayEventOnce("event:/SFX/Dawn/Dawn_Attack");
//PlayEventOnce("event:/Characters/sfx_footsteps_human");
PlayEventOnce("event:/SFX/Dawn/Dawn_Attack");
}
void SHADE::SHAudioSystem::Run(float dt)
@ -147,7 +148,7 @@ namespace SHADE
ErrorCheck();
}
if (system)
if (fmodStudioSystem)
{
result = fmodStudioSystem->release();
ErrorCheck();

View File

@ -13,6 +13,9 @@
#include "SHEditorComponentView.hpp"
#include "Graphics/MiddleEnd/Interface/SHRenderable.h"
#include "ECS_Base/Managers/SHSystemManager.h"
#include "AudioSystem/SHAudioSystem.h"
namespace SHADE
{
template<typename ComponentType, std::enable_if_t<std::is_base_of_v<SHComponent, ComponentType>, bool> = true>
@ -50,6 +53,14 @@ namespace SHADE
ImGui::InputText("##EntityName", &entity->name);
if (ImGui::Button("AUDIO"))
{
if (auto audioSystem = SHSystemManager::GetSystem<SHADE::SHAudioSystem>())
{
audioSystem->PlayEventOnce("event:/SFX/Dawn/Dawn_Attack");
}
}
if (auto transformComponent = SHComponentManager::GetComponent_s<SHTransformComponent>(eid))
{
DrawComponent(transformComponent);