#include "AudioEngine.hpp"
#include "Debug.hpp"

ma_engine* TSE::AudioEngine::engine = nullptr;

void TSE::AudioEngine::Init()
{
    ma_result res;
    engine = (ma_engine*)malloc(sizeof(*engine));
    res = ma_engine_init(nullptr, engine);
    if(res != MA_SUCCESS)
    {
        TSE_WARNING("Couldn't init audio engine. error code: " + std::to_string(res));
    }
}

void TSE::AudioEngine::Destroy()
{
    ma_engine_uninit(engine);
    delete(engine);
    engine = nullptr;
}
